public void CompareFileIdTest() { FileFolderStation target = new FileFolderStation(); FileInfo f = new FileInfo("12345.pdf"); string id = "12345"; int expected = 0; int compare = target.CompareFileId(f, id); Assert.AreEqual(expected, compare); compare = target.CompareFileId(f, "1235"); Assert.IsTrue(compare > 0); compare = target.CompareFileId(f, "1235X"); Assert.IsTrue(compare < 0); FileInfo f2 = new FileInfo(@"C:\DIR\12345"); compare = target.CompareFileId(f2, "12345"); Assert.IsTrue(compare == 0); f2 = new FileInfo(@"3478336"); compare = target.CompareFileId(f2, "12345678"); Assert.IsTrue(compare < 0); f2 = new FileInfo(@"ABC336.txt"); compare = target.CompareFileId(f2, "DEF335"); Assert.IsTrue(compare < 0); }
private FileFolderStation CreateTestStation() { ConfigData stationConfig = new ConfigData(configStream); FileFolderStation target = new FileFolderStation(); target.Initialize(stationConfig, memory, null); return target; }