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"); }); }
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"); }); }
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"); }); }
public ActionResult Create(CreatePersonInput input) { _personAppService.CreatePerson(input); return(Content("ok")); }
public object Post(CreatePersonInput input) { var result = _service.CreatePerson(input); return(new { Id = result }); }