public async Task InsertNewItemShouldAddItToRepository() { var apiClient = Web.ApiClient <TestStartup>() .WithAcceptJsonHeader() .WithFakeClaimsPrincipal(TestPrincipals.FullClaimsPrincipal); var peter = Actor.Named("Peter").CanUse(apiClient); await Given.That(peter).WithToDoItems(TestData.InitialToDos) .And().CouldInsertToDoItem(TestData.AddedItem).Successfully(); peter.UsingApiClient().ShouldReturn().HaveCreatedStatusCode(); }
public async Task ShowItemsShouldReturnAllToDoItems() { var apiClient = Web.ApiClient <TestStartup>() .WithAcceptJsonHeader() .WithFakeClaimsPrincipal(TestPrincipals.FullClaimsPrincipal); var peter = Actor.Named("Peter").CanUse(apiClient); // .And().CanUse<IToDoRepository>(); await Given.That(peter).WithToDoItems(TestData.InitialToDos) .And().CouldGet(Uris.ApiToDos).Successfully(); peter.UsingApiClient().ShouldReturn().HaveStatusCode(HttpStatusCode.OK) .And().Should().HaveToDos(TestData.InitialToDos); }