public void HasChangeFor_InLogNoChange_ReturnsFalse() { var log = new WritingSystemChangeLog(); log.LogChange("aaa", "bbb"); log.LogChange("bbb", "aaa"); Assert.That(log.HasChangeFor("aaa"), Is.False); }
public void GetChangeFor_InLogButNoChange_ReturnsSameId() { var log = new WritingSystemChangeLog(); log.LogChange("aaa", "bbb"); log.LogChange("bbb", "aaa"); Assert.That(log.GetChangeFor("aaa"), Is.EqualTo("aaa")); }
public void GetChangeFor_InLogButNoChange_ReturnsSameId() { var log = new WritingSystemChangeLog(); log.LogChange("aaa", "bbb"); log.LogChange("bbb", "aaa"); Assert.That(log.GetChangeFor("aaa"), Is.EqualTo("aaa")); }
public WritingSystemChangeLog GetSampleWritingSystemChangeLog() { var log = new WritingSystemChangeLog(); log.LogChange("aab", "bba"); log.LogChange("ccc", "ddd"); return(log); }
public void HasChangeFor_InLogNoChange_ReturnsFalse() { var log = new WritingSystemChangeLog(); log.LogChange("aaa", "bbb"); log.LogChange("bbb", "aaa"); Assert.That(log.HasChangeFor("aaa"), Is.False); }
public void HasChangeFor_NotInLog_ReturnsFalse() { var log = new WritingSystemChangeLog(); log.LogChange("aab", "bba"); Assert.That(log.HasChangeFor("fff"), Is.False); }
public void GetChangeFor_HasChange_ReturnsCorrectWsId() { var log = new WritingSystemChangeLog(); log.LogChange("aab", "bba"); Assert.That(log.GetChangeFor("aab"), Is.EqualTo("bba")); }
public void GetChangeFor_NotInLog_ReturnsNull() { var log = new WritingSystemChangeLog(); log.LogChange("aab", "bba"); Assert.That(log.GetChangeFor("fff"), Is.EqualTo(null)); }
public void HasChangeFor_InLogHasChange_ReturnsTrue() { var log = new WritingSystemChangeLog(); log.LogChange("aab", "bba"); Assert.That(log.HasChangeFor("aab"), Is.True); }
public void LogChange_FromSameAsTo_DoesNotLogChange() { var log = new WritingSystemChangeLog(); log.LogChange("aaa", "aaa"); Assert.That(log.GetChangeFor("aaa"), Is.EqualTo(null)); }
public void Write_NewEmptyFile_WritesModelToLogFile() { using (var e = new TestEnvironment()) { string tempFilePath = Path.Combine(e._tempFolder.Path, "testchangelog.xml"); var log = new WritingSystemChangeLog(new WritingSystemChangeLogDataMapper(tempFilePath)); log.LogChange("aab", "bba"); log.LogAdd("aab"); log.LogDelete("aab"); log.LogConflate("aab", "bba"); AssertThatXmlIn.File(tempFilePath).HasAtLeastOneMatchForXpath("/WritingSystemChangeLog/Changes/Change/From[text()='aab']"); AssertThatXmlIn.File(tempFilePath).HasAtLeastOneMatchForXpath("/WritingSystemChangeLog/Changes/Change/To[text()='bba']"); AssertThatXmlIn.File(tempFilePath).HasAtLeastOneMatchForXpath("/WritingSystemChangeLog/Changes/Add/Id[text()='aab']"); AssertThatXmlIn.File(tempFilePath).HasAtLeastOneMatchForXpath("/WritingSystemChangeLog/Changes/Delete/Id[text()='aab']"); AssertThatXmlIn.File(tempFilePath).HasAtLeastOneMatchForXpath("/WritingSystemChangeLog/Changes/Merge/From[text()='aab']"); AssertThatXmlIn.File(tempFilePath).HasAtLeastOneMatchForXpath("/WritingSystemChangeLog/Changes/Merge/To[text()='bba']"); } }
public void Write_NewEmptyFile_WritesModelToLogFile() { using (var e = new TestEnvironment()) { string tempFilePath = Path.Combine(e._tempFolder.Path, "testchangelog.xml"); var log = new WritingSystemChangeLog(new WritingSystemChangeLogDataMapper(tempFilePath)); log.LogChange("aab", "bba"); log.LogAdd("aab"); log.LogDelete("aab"); log.LogConflate("aab","bba"); AssertThatXmlIn.File(tempFilePath).HasAtLeastOneMatchForXpath("/WritingSystemChangeLog/Changes/Change/From[text()='aab']"); AssertThatXmlIn.File(tempFilePath).HasAtLeastOneMatchForXpath("/WritingSystemChangeLog/Changes/Change/To[text()='bba']"); AssertThatXmlIn.File(tempFilePath).HasAtLeastOneMatchForXpath("/WritingSystemChangeLog/Changes/Add/Id[text()='aab']"); AssertThatXmlIn.File(tempFilePath).HasAtLeastOneMatchForXpath("/WritingSystemChangeLog/Changes/Delete/Id[text()='aab']"); AssertThatXmlIn.File(tempFilePath).HasAtLeastOneMatchForXpath("/WritingSystemChangeLog/Changes/Merge/From[text()='aab']"); AssertThatXmlIn.File(tempFilePath).HasAtLeastOneMatchForXpath("/WritingSystemChangeLog/Changes/Merge/To[text()='bba']"); } }
public void GetChangeFor_HasChange_ReturnsCorrectWsId() { var log = new WritingSystemChangeLog(); log.LogChange("aab", "bba"); Assert.That(log.GetChangeFor("aab"), Is.EqualTo("bba")); }
public WritingSystemChangeLog GetSampleWritingSystemChangeLog() { var log = new WritingSystemChangeLog(); log.LogChange("aab", "bba"); log.LogChange("ccc", "ddd"); return log; }
public void HasChangeFor_InLogHasChange_ReturnsTrue() { var log = new WritingSystemChangeLog(); log.LogChange("aab", "bba"); Assert.That(log.HasChangeFor("aab"), Is.True); }
public void LogChange_FromSameAsTo_DoesNotLogChange() { var log = new WritingSystemChangeLog(); log.LogChange("aaa", "aaa"); Assert.That(log.GetChangeFor("aaa"), Is.EqualTo(null)); }
public void GetChangeFor_NotInLog_ReturnsNull() { var log = new WritingSystemChangeLog(); log.LogChange("aab", "bba"); Assert.That(log.GetChangeFor("fff"), Is.EqualTo(null)); }
public void HasChangeFor_NotInLog_ReturnsFalse() { var log = new WritingSystemChangeLog(); log.LogChange("aab", "bba"); Assert.That(log.HasChangeFor("fff"), Is.False); }