Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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);
        }