public void MergeNewConnStringFromDummy2() { string file1 = "File1.Xml"; string file2 = "File2.Xml"; NDOMapping map1 = NDOMapping.Create(file1); map1.AddStandardClass(classMitarbeiter, assName, null); map1.Save(); NDOMapping map2 = NDOMapping.Create(file2); map2.AddStandardClass(classMitarbeiter, assName, null); map2.Save(); map1 = new NDOMapping(file1); map2 = new NDOMapping(file2); Assert.AreEqual(Connection.DummyConnectionString, ((Connection)map1.Connections[0]).Name, "Must be dummy connection"); Assert.AreEqual(Connection.DummyConnectionString, ((Connection)map2.Connections[0]).Name, "Must be dummy connection"); ((Connection)map1.Connections[0]).Name = "Some new string"; map1.MergeMapping(map2); Assert.AreEqual(1, map1.Connections.Count, "Falsche Anzahl Connections"); Class c = map1.FindClass(classMitarbeiter); Assert.NotNull(c, "Mitarbeiter nicht gefunden"); Assert.AreEqual("C0", c.ConnectionId, "Connection falsch"); File.Delete(file1); File.Delete(file2); }
public void MergeNewConnStringClassChanged() { string file1 = "File1.Xml"; string file2 = "File2.Xml"; NDOMapping map1 = NDOMapping.Create(file1); map1.AddStandardClass(classMitarbeiter, assName, null); ((Connection)map1.Connections[0]).Name = "Alter ConnectionString"; map1.Save(); NDOMapping map2 = NDOMapping.Create(file2); map2.AddStandardClass(classMitarbeiter, assName, null); ((Connection)map2.Connections[0]).Name = "Neuer ConnectionString"; ((Class)map2.Classes[0]).AssemblyName = "New Assembly-Name"; map2.Save(); map1 = new NDOMapping(file1); map2 = new NDOMapping(file2); map1.MergeMapping(map2); Assert.AreEqual(2, map1.Connections.Count, "Falsche Anzahl Connections"); Assert.AreEqual(1, map1.Classes.Count, "Falsche Anzahl Klassen"); Class c = map1.FindClass(classMitarbeiter); Assert.NotNull(c, "Mitarbeiter nicht gefunden"); Assert.AreEqual("C1", c.ConnectionId, "Connection falsch"); File.Delete(file1); File.Delete(file2); }
public void MergeEqualNewConnName() { string file1 = "File1.Xml"; string file2 = "File2.Xml"; NDOMapping map1 = NDOMapping.Create(file1); map1.AddStandardClass(classMitarbeiter, assName, null); map1.Save(); NDOMapping map2 = NDOMapping.Create(file2); map2.AddStandardClass(classMitarbeiter, assName, null); ((Connection)map2.Connections[0]).ID = "C1"; map2.Save(); map1 = new NDOMapping(file1); map2 = new NDOMapping(file2); map1.MergeMapping(map2); Assert.AreEqual(1, map1.Classes.Count, "Falsche Anzahl Klassen"); Assert.AreEqual(1, map1.Connections.Count, "Falsche Anzahl Connections"); File.Delete(file1); File.Delete(file2); }