public void WhenOpenedWithNonExistingFileShouldReturnOpenedNewDb() { var sut = new FileCacheRepository(); string path = @"C:\Project\TestData\PhotoSpaceSaverDb\NonExistingFile.db"; try { File.Delete(path); } catch (Exception) { // nop } Assert.AreEqual(FileCacheRepository.OpenResult.OpenedNewDb, sut.Open(path)); }
public void WhenOpenedWithNonExistingDirectoryPathShouldReturnOpenFailed() { var sut = new FileCacheRepository(); Assert.AreEqual(FileCacheRepository.OpenResult.OpenFailed, sut.Open(@"C:\Project\TestData\PhotoSpaceSaverDb\ThisDirectoryDoesNotExist\File.db")); }
public void WhenOpenedWithExistingInvalidFileShouldReturnOpenFailed() { var sut = new FileCacheRepository(); Assert.AreEqual(FileCacheRepository.OpenResult.OpenFailed, sut.Open(@"C:\Project\TestData\PhotoSpaceSaverDb\ExistingInvalidDb.db")); }