当前位置: 首页>>代码示例>>C#>>正文


C# VolunteerService.GetPersonDetailsForChangeContactInfo方法代码示例

本文整理汇总了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);
        }
开发者ID:vkarosas,项目名称:crisischeckin,代码行数:38,代码来源:VolunteerServiceTest.cs

示例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);
        }
开发者ID:dayewah,项目名称:crisischeckin,代码行数:33,代码来源:VolunteerServiceTest.cs


注:本文中的VolunteerService.GetPersonDetailsForChangeContactInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。