public void EnvironmentRepositoryWriteSessionWithNonExistingFileExpectedCreatesFile()
{
var path = EnvironmentRepository.GetEnvironmentsFilePath();
var bakPath = RetryUtility.RetryMethod(() => BackupFile(path), 15, 1000, null);
var source = new Mock<IEnvironmentModel>();
var repo = new TestEnvironmentRespository(source.Object) { IsReadWriteEnabled = true };
repo.WriteSession(null);
var exists = File.Exists(path);
Assert.AreEqual(true, exists);
// ReSharper disable ImplicitlyCapturedClosure
RetryUtility.RetryAction(() => DeleteFile(path), 15, 1000);
// ReSharper restore ImplicitlyCapturedClosure
RetryUtility.RetryAction(() => RestoreFile(path, bakPath), 15, 1000);
}