Пример #1
0
        public async Task CanGetRealStuffFromApi()
        {
            var realStuffHolder = new RealStuffHolder("real stuff", TimeSpan.Zero);
            var testServer      = await ApiTestServer.StartNew(realStuffHolder);

            var responseBody = GetStuffFromApi(testServer.baseUrl);

            Assert.Contains("real stuff", responseBody);

            await testServer.Stop();
        }
Пример #2
0
        public async Task CanGetFakeStuffFromApi()
        {
            var fakeStuffHolder = new InMemoryStuffHolder();
            var testServer      = await ApiTestServer.StartNew(fakeStuffHolder);

            var responseBody = GetStuffFromApi(testServer.baseUrl);

            Assert.Contains("fake stuff", responseBody);

            await testServer.Stop();
        }