public void InitFromUri_GivenCompleteUri_AllPropertiesCorrect() { using (var testFolder = new TemporaryFolder("clonetest")) { var model = new InternetCloneSettingsModel(testFolder.Path); model.InitFromUri("http://*****:*****@hg-languagedepot.org/tpi?localFolder=tokPisin"); Assert.AreEqual("tokPisin", model.LocalFolderName); Assert.IsTrue(model.ReadyToDownload); Assert.AreEqual("http://*****:*****@hg-languagedepot.org/tpi",model.URL); } }
public void URL_AfterConstruction_GoodDefault() { using (var testFolder = new TemporaryFolder("clonetest")) { var model = new InternetCloneSettingsModel(testFolder.Path); model.AccountName = "account"; model.Password = "******"; model.ProjectId = "id"; Assert.AreEqual("http://*****:*****@resumable.languagedepot.org/id", model.URL.ToLower()); } }
public void CleanUpAfterErrorOrCancel_DirectoryDeleted() { using (var testFolder = new TemporaryFolder("clonetest")) { var model = new InternetCloneSettingsModel(testFolder.Path); model.LocalFolderName = "SomeFolder"; // Ideally would call model to start the clone - but that's in the dialog for now so fake it instead. Directory.CreateDirectory(model.TargetDestination); Assert.That(Directory.Exists(model.TargetDestination), Is.True); model.CleanUpAfterErrorOrCancel(); Assert.That(Directory.Exists(model.TargetDestination), Is.False); } }