public void CorrectStringTest(string path, string expected) { _stringFormatterMock.Setup(s => s.ShortFileString(path)).Returns(expected); var fileRepo = new TemporaryFileRepository(_stringFormatterMock.Object); fileRepo.Add(path); CollectionAssert.Contains(fileRepo.Paths, expected); }
public void NullStringTest() { string path = null; _stringFormatterMock.Setup(s => s.ShortFileString(path)).Throws <NullReferenceException>(); var fileRepo = new TemporaryFileRepository(_stringFormatterMock.Object); Assert.Throws <NullReferenceException>(() => fileRepo.Add(path)); }
public void CorrectStringTest(string path, string expected) { var stringFormatter = new CorrectStringFormatterMock(expected); var fileRepo = new TemporaryFileRepository(stringFormatter); fileRepo.Add(path); CollectionAssert.Contains(fileRepo.Paths, expected); }
public void NullStringTest() { string path = null; var stringFormatter = new NullStringFormatterMock(); var fileRepo = new TemporaryFileRepository(stringFormatter); Assert.Throws <NullReferenceException>(() => fileRepo.Add(path)); }
public void EmptyStringTest() { string path = String.Empty; string expected = String.Empty; _stringFormatterMock.Setup(s => s.ShortFileString(path)).Returns(String.Empty); var fileRepo = new TemporaryFileRepository(_stringFormatterMock.Object); fileRepo.Add(path); CollectionAssert.Contains(fileRepo.Paths, expected); }
public void EmptyStringTest() { string path = String.Empty; string expected = String.Empty; var stringFormatter = new EmptyStringFormatterMock(); var fileRepo = new TemporaryFileRepository(stringFormatter); fileRepo.Add(path); CollectionAssert.Contains(fileRepo.Paths, expected); }