public void Commandreader_CommandFileAccessorConstructorTest() { string FileNameStr = "Filename.ext"; CommandFileAccessor target = new CommandFileAccessor(FileNameStr); Assert.IsNotNull(target); Assert.AreEqual(target.FileNameStr, FileNameStr); }
public void Commandreader_CommandFileAccessorConstructorTest1() { CommandFileAccessor target = new CommandFileAccessor(); Assert.IsNotNull(target); //Assert.IsNull(target.FileNameStr); string expected = string.Empty; Assert.AreEqual(expected, target.FileNameStr); }
public void ReadFromFileTest_FileNotExists() { string FileNameStr = "Filename.ext"; CommandFileAccessor target = new CommandFileAccessor(FileNameStr); string ResultLine = string.Empty; string ResultLineStartExpected = "File '"; string ResultLineEndExpected = "Filename.ext' not found"; string expected = string.Empty; string actual; actual = target.GetCommandLine(ref ResultLine); //Assert.AreEqual(ResultLineExpected, ResultLine); Assert.IsTrue(ResultLine.StartsWith(ResultLineStartExpected)); Assert.IsTrue(ResultLine.EndsWith(ResultLineEndExpected)); Assert.AreEqual(expected, actual); //Assert.IsTrue(actual.StartsWith(expectedStart)); //Assert.IsTrue(actual.EndsWith(expectedEnd)); }