本文整理汇总了C#中VolunteerService.GetPersonDetailsForChangeContactInfo方法的典型用法代码示例。如果您正苦于以下问题:C# VolunteerService.GetPersonDetailsForChangeContactInfo方法的具体用法?C# VolunteerService.GetPersonDetailsForChangeContactInfo怎么用?C# VolunteerService.GetPersonDetailsForChangeContactInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VolunteerService
的用法示例。
在下文中一共展示了VolunteerService.GetPersonDetailsForChangeContactInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPersonDetailsForChangeContactInfoReturnsExpectedData
public void GetPersonDetailsForChangeContactInfoReturnsExpectedData()
{
var personOne = new Person
{
Id = 1,
UserId = 6,
FirstName = "Cathy",
LastName = "Jones",
Email = "[email protected]",
PhoneNumber = "555-222-9139",
ClusterId = 1
};
var personTwo = new Person
{
Id = 2,
UserId = 7,
FirstName = "Stan",
LastName = "Smith",
Email = "[email protected]",
PhoneNumber = "111-333-2222"
};
var dataService = new Mock<IDataService>();
var personList = new List<Person>
{
personOne,
personTwo
};
dataService.Setup(x => x.Persons).Returns(personList.AsQueryable());
var underTest = new VolunteerService(dataService.Object);
var result = underTest.GetPersonDetailsForChangeContactInfo(personTwo.UserId.GetValueOrDefault());
Assert.IsNotNull(result);
Assert.AreEqual(personTwo.Email, result.Email);
Assert.AreEqual(personTwo.PhoneNumber, result.PhoneNumber);
}
示例2: GetPersonDetailsForChangeContactInfoThrowsExpectedPersonNotFoundException
public void GetPersonDetailsForChangeContactInfoThrowsExpectedPersonNotFoundException()
{
var personOne = new Person
{
Id = 1,
UserId = 6,
FirstName = "Cathy",
LastName = "Jones",
Email = "[email protected]",
PhoneNumber = "555-222-9139",
};
var personTwo = new Person
{
Id = 2,
UserId = 7,
FirstName = "Stan",
LastName = "Smith",
Email = "[email protected]",
PhoneNumber = "111-333-2222"
};
var dataService = new Mock<IDataService>();
var personList = new List<Person>
{
personOne,
personTwo
};
dataService.Setup(x => x.Persons).Returns(personList.AsQueryable());
var underTest = new VolunteerService(dataService.Object);
var result = underTest.GetPersonDetailsForChangeContactInfo(8);
}