public void Read_IfFileNotExists_ReturnsNull() { // arrange var Application = GetApllicationMock(); var File = GetFileWrapMock(false); InternalConfigManager Manager = new InternalConfigManager(File.Object, Application.Object); // action var Date = Manager.GetMaxDate(); // assert Assert.IsNull(Date); }
public void Read_IfFileIsEmpty_ReturnsNull() { // arrange var Application = GetApllicationMock(); var File = GetFileWrapMock(false); File.Setup(s => s.ReadAllLines(@"C:\archivos de programa\test\maxdate.txt")).Returns(new string[] {}); InternalConfigManager Manager = new InternalConfigManager(File.Object, Application.Object); // action var Date = Manager.GetMaxDate(); // assert Assert.IsNull(Date); }
public void Read_IfFileExists_ReturnsDate() { // arrange var File = GetFileWrapMock(true); var Application = GetApllicationMock(); File.Setup(s => s.ReadAllLines(@"C:\archivos de programa\test\maxdate.txt")).Returns(new[] {@"07/08/2013"}); InternalConfigManager Manager = new InternalConfigManager(File.Object, Application.Object); // action var Date = Manager.GetMaxDate(); // assert Assert.AreEqual(DateTime.Parse("08/07/2013 00:00"), Date.Value); }