public void Should_set_proccessed_datasource_to_CustomGroupWrapper_inner_enumerable_when_such_is_provided_and_custom_binding_is_true() { var expectedValue = DataSource(2); var customWrapper = new GridCustomGroupingWrapper <int>(expectedValue); context.SetupGet(c => c.EnableCustomBinding).Returns(true); context.SetupGet(c => c.DataSource).Returns(customWrapper); Assert.True(expectedValue.Cast <int>().SequenceEqual(dataProcessor.ProcessedDataSource.Cast <int>())); }
public void Should_throw_if_datasource_is_CustomGroupWrapper_and_no_custom_binding_is_enabled() { var customWrapper = new GridCustomGroupingWrapper <int>(DataSource(2)); context.SetupGet(c => c.EnableCustomBinding).Returns(false); context.SetupGet(c => c.DataSource).Returns(customWrapper); IEnumerable result; Assert.Throws <InvalidOperationException>(() => result = dataProcessor.ProcessedDataSource); }
public void Should_throw_if_datasource_is_CustomGroupWrapper_and_no_custom_binding_is_enabled() { var customWrapper = new GridCustomGroupingWrapper<int>(DataSource(2)); context.SetupGet(c => c.EnableCustomBinding).Returns(false); context.SetupGet(c => c.DataSource).Returns(customWrapper); IEnumerable result; Assert.Throws<InvalidOperationException>(() => result = dataProcessor.ProcessedDataSource); }
public void Should_set_proccessed_datasource_to_CustomGroupWrapper_inner_enumerable_when_such_is_provided_and_custom_binding_is_true() { var expectedValue = DataSource(2); var customWrapper = new GridCustomGroupingWrapper<int>(expectedValue); context.SetupGet(c => c.EnableCustomBinding).Returns(true); context.SetupGet(c => c.DataSource).Returns(customWrapper); Assert.True(expectedValue.Cast<int>().SequenceEqual(dataProcessor.ProcessedDataSource.Cast<int>())); }