private EntityObjectDataLoaderFactory CreateSut() { var bindingsBuilder = new EntityObjectDataLoader.BindingsBuilder() .Add <TestModelDataLoader>(); return(new EntityObjectDataLoaderFactory(bindingsBuilder.Build())); }
private EntityObjectDataLoaderFactory CreateSut() { var bindingsBuilder = new EntityObjectDataLoader.BindingsBuilder() .Add<TestModelDataLoader>(); return new EntityObjectDataLoaderFactory(bindingsBuilder.Build()); }
public void Build_EmptyBindings_ShouldReturnEmptyBindings() { // Setup var sut = new EntityObjectDataLoader.BindingsBuilder(); // Exercise var bindings = sut.Build(); // Verify Assert.True(!bindings.Any(), "Bindings count should be 0"); }
public void Build_EmptyBindings_ShouldReturnEmptyBindings() { // Setup var sut = new EntityObjectDataLoader.BindingsBuilder(); // Exercise var bindings = sut.Build(); // Verify Assert.True(!bindings.Any(), "Bindings count should be 0"); }
public void SetArgument_ShouldBeEqualToExpectedBindings() { // Setup var expected = new EntityObjectDataLoader.BindingsBuilder().Add <TestModelDataLoader>().Build(); var sut = new EntityObjectDataLoader(); // Exercise sut.Argument = Newtonsoft.Json.JsonConvert.SerializeObject(expected); //Verify outcome var actual = sut.Bindings; Assert.Collection(expected.Keys, (s) => actual.Keys.Contains(s)); Assert.Collection(expected.Values, (s) => actual.Values.Contains(s)); }
public void AddOfTEntityDataLoader_CustomTableName_ShouldContainKeyAndValue() { // Setup var sut = new EntityObjectDataLoader.BindingsBuilder(); var testModelDataLoaderType = typeof(TestModelDataLoader); var expectedKey = "TestModel"; var expectedValue = string.Format("{0}, {1}", testModelDataLoaderType.FullName, testModelDataLoaderType.Assembly.FullName); // Exercise sut.Add <TestModelDataLoader>(expectedKey); var actual = sut.Build(); // Verify Assert.Contains(actual, (kv) => kv.Key == expectedKey && kv.Value == expectedValue); }
public void AddOfTEntityDataLoader_CustomTableName_ShouldContainKeyAndValue() { // Setup var sut = new EntityObjectDataLoader.BindingsBuilder(); var testModelDataLoaderType = typeof(TestModelDataLoader); var expectedKey = "TestModel"; var expectedValue = string.Format("{0}, {1}", testModelDataLoaderType.FullName, testModelDataLoaderType.Assembly.FullName); // Exercise sut.Add<TestModelDataLoader>(expectedKey); var actual = sut.Build(); // Verify Assert.Contains(actual, (kv) => kv.Key == expectedKey && kv.Value == expectedValue); }
public void GetArgument_ShouldBeEqualToExpectedBindings() { // Setup EntityObjectDataLoader.BindingsBuilder expectedBindings = null; var sut = new EntityObjectDataLoader(bindings => { bindings.Add <TestModelDataLoader>(); expectedBindings = bindings; }); var expected = Newtonsoft.Json.JsonConvert.SerializeObject(expectedBindings.Build()); // Exercise var actual = sut.Argument; // Verify outcome Assert.Equal(expected, actual); }
public void SetArgument_ShouldBeEqualToExpectedBindings() { // Setup var expected = new EntityObjectDataLoader.BindingsBuilder().Add<TestModelDataLoader>().Build(); var sut = new EntityObjectDataLoader(); // Exercise sut.Argument = Newtonsoft.Json.JsonConvert.SerializeObject(expected); //Verify outcome var actual = sut.Bindings; Assert.Collection(expected.Keys, (s) => actual.Keys.Contains(s)); Assert.Collection(expected.Values, (s) => actual.Values.Contains(s)); }