コード例 #1
0
        public async Task Get_ReturnsExpectedFeature()
        {
            var client = factory.CreateClient();
            await client.GetAsync("/"); // Invoke Initialize of IFeatureProvider

            var testFeature = new TestFeature
            {
                Value = true
            };

            await TestStartup.Options.Provider.Set(testFeature);

            var response = await client.GetAsync(
                $"{TestStartup.Options.ApiGetPath}?feature={testFeature.GetType().Name}");

            response.EnsureSuccessStatusCode();

            var feature = await response.Content.ReadAsJson <TestFeature>();

            Assert.True(feature.Value);
        }
コード例 #2
0
        public void TestFeature_has_correct_name()
        {
            var feature = new TestFeature();

            Assert.Equal("TestFeature", feature.Name);
        }
コード例 #3
0
        public void TestFeature_has_correct_description()
        {
            var feature = new TestFeature();

            Assert.Equal("Test feature description.", feature.Description);
        }