public void GetIntegrationPath_includes_filename() { Mock <IFilesystemIo> filesystem = GetFilesystemMock(); var pathprovider = new AppDataPathProvider(filesystem.Object); //Act var returnedIntegrationPath = pathprovider.GetPathToIntegrationFile(); //Assert Assert.AreEqual(@$ "{fullPathForIntegration}\{pathprovider.IntegrationFileName}", returnedIntegrationPath);
public void GetIntegrationPath_returns_correct_path() { Mock <IFilesystemIo> filesystem = GetFilesystemMock(); var pathprovider = new AppDataPathProvider(filesystem.Object); //Act var returnedIntegrationPath = pathprovider.GetPathToIntegrationFile(); //Assert Assert.IsTrue(returnedIntegrationPath.StartsWith(fullPathForIntegration)); }
public void Throws_InvalidOperationException_if_appdata_folder_does_not_exist() { //Arrange var filesystem = GetFilesystemMock(appDataPath: string.Empty); var pathprovider = new AppDataPathProvider(filesystem.Object); //Act && //Assert Assert.ThrowsException <InvalidOperationException>(() => _ = pathprovider.GetStorageBasePath()); Assert.ThrowsException <InvalidOperationException>(() => _ = pathprovider.GetPathToIntegrationFile()); }
public void IntegrationPath_creates_the_directory() { //Arrange var filesystem = GetFilesystemMock(); var pathprovider = new AppDataPathProvider(filesystem.Object); //Act _ = pathprovider.GetPathToIntegrationFile(); //Assert filesystem.Verify(mock => mock.CreateDirectory(fullPathForIntegration), Times.Once); }
public void IntegrationPath_gets_and_uses_the_AppData_path() { //Arrange var filesystem = GetFilesystemMock(); var pathprovider = new AppDataPathProvider(filesystem.Object); //Act var returnedPath = pathprovider.GetPathToIntegrationFile(); //Assert filesystem.Verify(mock => mock.GetFolderPath(Environment.SpecialFolder.ApplicationData), Times.Once); Assert.IsTrue(returnedPath.StartsWith(AppDataPath)); }
public void Adds_bkhedblom_StoryBuckets_to_the_appdata_path() { //Arrange var filesystem = GetFilesystemMock(); var pathprovider = new AppDataPathProvider(filesystem.Object); //Act var returnedStoragePath = pathprovider.GetStorageBasePath(); var returnedIntegrationPath = pathprovider.GetPathToIntegrationFile(); //Assert Assert.IsTrue(returnedStoragePath.StartsWith(appDataForStoryBuckets)); Assert.IsTrue(returnedIntegrationPath.StartsWith(appDataForStoryBuckets)); }