public async void Should_Create_Person_With_Valid_Arguments()
        {
            await _personAppService.CreatePerson(
                new CreatePersonInput
            {
                Name         = "John",
                SurName      = "Nash",
                EmailAddress = "*****@*****.**"
            });

            UsingDbContext(
                context =>
            {
                var john = context.Persons.FirstOrDefault(p => p.EmailAddress == "*****@*****.**");
                john.ShouldNotBe(null);
                john.Name.ShouldBe("John");
            });
        }
示例#2
0
        public async Task <IActionResult> Register(Person Input)
        {
            var personnew = await _personAppService.CreatePerson(Input);

            var output = _personAppService.GetPeopleList();

            output.Add(personnew);
            output.OrderByDescending(t => t.CreationTime);
            return(View("PeopleList", output));
        }
        public async Task Should_Create_Person_With_Valid_Arghuments()
        {
            //act
            await _personAppService.CreatePerson(new CreatePersonInput()
            {
                Name         = "Paris",
                Surname      = "Hilton",
                EmailAddress = "*****@*****.**"
            });

            //assert
            UsingDbContext(
                context =>
            {
                var paris = context.Persons.FirstOrDefault(p => p.EmailAddress == "*****@*****.**");
                paris.ShouldNotBe(null);
                paris.Name.ShouldBe("Paris");
            });
        }
示例#4
0
        public async Task Should_Create_Person_With_Valid_Arguments()
        {
            await _personAppService.CreatePerson(
                new CreatePersonInput
            {
                Name         = "John",
                Surname      = "Nash",
                EmailAddress = "*****@*****.**"
            });

            // Assert
            UsingDbContext(
                context =>
            {
                var john = context.People.FirstOrDefault(p => p.EmailAddress == "*****@*****.**");
                john.ShouldNotBe(null);
                john.Name.ShouldBe("John");
            });
        }
示例#5
0
 public ActionResult Create(CreatePersonInput input)
 {
     _personAppService.CreatePerson(input);
     return(Content("ok"));
 }
示例#6
0
        public object Post(CreatePersonInput input)
        {
            var result = _service.CreatePerson(input);

            return(new { Id = result });
        }