public void EnvRenameDupWithFileNameExist() { //Arrange ProjEnvironment env1 = new ProjEnvironment() { Name = "MyEnv" }; mSolutionRepository.AddRepositoryItem(env1); //Act env1.Name = "MyEnv New name"; env1.Save(); // now we add another env with same name - should not let it save with same file name as #1 ProjEnvironment env2 = new ProjEnvironment() { Name = "MyEnv" }; mSolutionRepository.AddRepositoryItem(env2); //Assert // Make sure we got new file name Assert.AreNotEqual(env1.FilePath, env2.FilePath); }
public void EnvRenameshouldKeepOriginalFileName() { //Arrange ProjEnvironment env1 = new ProjEnvironment() { Name = "EV1" }; mSolutionRepository.AddRepositoryItem(env1); string filePath = env1.FilePath; //Act env1.Name = "EV1 A"; env1.Save(); //Assert Assert.AreEqual(filePath, env1.FilePath); }