public async Task TestStringQueryParameter(string expectedParameter, FormatterSelection formatter)
        {
            var client          = Client <ISerializeParameterController>(formatter);
            var actualParameter = await client.GetStringQueryParameter(expectedParameter);

            Assert.Equal(expectedParameter, actualParameter);
        }
예제 #2
0
        public async Task TestDateTimeUrlParameter(DateTime?expectedParameter, FormatterSelection formatter)
        {
            var client          = Client <ISerializeParameterController>(formatter);
            var actualParameter = await client.GetDateTimeUrlParameter(expectedParameter);

            Assert.Equal(expectedParameter, actualParameter);
        }
예제 #3
0
        public void element_selection_select_is_straight_passthrough_with_formatters()
        {
            var accessor1 = ReflectionHelper.GetAccessor <GridDefinitionTester.GridDefTarget>(x => x.Name);
            var selection = new FormatterSelection(a => a.Name == "Name", SlickGridFormatter.Underscore);

            selection.FormatterFor(accessor1).ShouldEqual(SlickGridFormatter.Underscore);
        }
        public async Task TestNullItemBodyParameter(FormatterSelection formatter)
        {
            var client     = Client <ISerializeParameterController>(formatter);
            var actualItem = await client.GetItemBodyParameter(null);

            Assert.Null(actualItem);
        }
        public async Task TestGuidListUrlParameter(List <Guid> expectedParameter, FormatterSelection formatter)
        {
            var client          = Client <ISerializeParameterController>(formatter);
            var actualParameter = await client.GetGuidListUrlParameter(expectedParameter);

            Assert.Equal(expectedParameter, actualParameter);
        }
예제 #6
0
        public async Task TestEmptyGuidListBodyParameter(FormatterSelection formatter)
        {
            var client       = Client <ISerializeParameterController>(formatter);
            var expectedItem = new List <Guid>();
            var actualItem   = await client.GetGuidListBodyParameter(5, expectedItem);

            Assert.Equal(expectedItem, actualItem);
        }
예제 #7
0
        public async Task TestBodyParameterAsLastParameter(FormatterSelection formatter)
        {
            var client       = Client <ISerializeParameterController>(formatter);
            var expectedItem = await ItemsGenerator.GenerateItem();

            var actualItem = await client.GetItemBodyParameterAsLastParameter(ItemsGenerator.TestGuid, "Test", expectedItem);

            Assert.Equal(expectedItem, actualItem);
        }
예제 #8
0
        public async Task TestBodyParameterWithNoAttribute(FormatterSelection formatter)
        {
            var client       = Client <ISerializeParameterController>(formatter);
            var expectedItem = await ItemsGenerator.GenerateItem();

            var actualItem = await client.GetItemBodyParameterWithNoAttribute(expectedItem);

            Assert.NotEqual(expectedItem, actualItem);
        }
예제 #9
0
        public void element_selection_matches_with_formatters()
        {
            var accessor1 = ReflectionHelper.GetAccessor <GridDefinitionTester.GridDefTarget>(x => x.Name);
            var accessor2 = ReflectionHelper.GetAccessor <GridDefinitionTester.GridDefTarget>(x => x.IsCool);

            var selection = new FormatterSelection(a => a.Name == "Name", SlickGridFormatter.Underscore);

            selection.Matches(accessor1).ShouldBeTrue();
            selection.Matches(accessor2).ShouldBeFalse();
        }
        public void element_selection_select_is_straight_passthrough_with_formatters()
        {
            var accessor1 = ReflectionHelper.GetAccessor<GridDefinitionTester.GridDefTarget>(x => x.Name);
            var selection = new FormatterSelection(a => a.Name == "Name", SlickGridFormatter.Underscore);

            selection.FormatterFor(accessor1).ShouldEqual(SlickGridFormatter.Underscore);
        }
        public void element_selection_matches_with_formatters()
        {
            var accessor1 = ReflectionHelper.GetAccessor<GridDefinitionTester.GridDefTarget>(x => x.Name);
            var accessor2 = ReflectionHelper.GetAccessor<GridDefinitionTester.GridDefTarget>(x => x.IsCool);

            var selection = new FormatterSelection(a => a.Name == "Name", SlickGridFormatter.Underscore);

            selection.Matches(accessor1).ShouldBeTrue();
            selection.Matches(accessor2).ShouldBeFalse();
        }