public async Task TestStringQueryParameter(string expectedParameter, FormatterSelection formatter) { var client = Client <ISerializeParameterController>(formatter); var actualParameter = await client.GetStringQueryParameter(expectedParameter); Assert.Equal(expectedParameter, actualParameter); }
public async Task TestDateTimeUrlParameter(DateTime?expectedParameter, FormatterSelection formatter) { var client = Client <ISerializeParameterController>(formatter); var actualParameter = await client.GetDateTimeUrlParameter(expectedParameter); Assert.Equal(expectedParameter, actualParameter); }
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); }
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); }
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); }
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); }
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(); }