public void DoesNotExistPassesWhenDirectoryInfoDoesNotExist() { DirectoryAssert.DoesNotExist(new DirectoryInfo(BAD_DIRECTORY)); }
public void DoesNotExistPassesWhenStringDoesNotExist() { DirectoryAssert.DoesNotExist(BAD_DIRECTORY); }
public void ExistsFailsWhenStringDoesNotExist() { var ex = Assert.Throws <AssertionException>(() => DirectoryAssert.Exists(BAD_DIRECTORY)); Assert.That(ex.Message, Does.StartWith(" Expected: directory exists")); }
public void DoesNotExistFailsWhenStringExists() { var ex = Assert.Throws <AssertionException>(() => DirectoryAssert.DoesNotExist(_goodDir1.ToString())); Assert.That(ex.Message, Does.StartWith(" Expected: not directory exists")); }
public void IsNotEmptyThrowsUsingNull() { DirectoryAssert.IsNotEmpty((DirectoryInfo)null); }
public void test5() { DirectoryAssert.Exists("some directory"); }
public void ReferenceEqualsFailsWhenUsed() { var ex = Assert.Throws <InvalidOperationException>(() => DirectoryAssert.ReferenceEquals(string.Empty, string.Empty)); Assert.That(ex.Message, Does.StartWith("DirectoryAssert.ReferenceEquals should not be used for Assertions")); }
public void ShowBlueprintPath() { fsat = new FileSystemAdministrativeTools(); DirectoryAssert.Exists(fsat.GetGameDataSaveLocation()); fsat = null; }
public void JavaSdkPathExists() { DirectoryAssert.Exists(XamarinAndroid.JavaSdkPath); }
private void ValidateMvcMusicStore(TestSolutionAnalysis results, string version) { var analysisResult = results.ProjectResults.FirstOrDefault().ProjectAnalysisResult; var csProjContent = results.ProjectResults.FirstOrDefault().CsProjectContent; string projectDir = results.ProjectResults.FirstOrDefault().ProjectDirectory; StringAssert.Contains("HtmlEncoder", analysisResult); StringAssert.Contains("EntityFrameworkCore", analysisResult); var accountControllerText = File.ReadAllText(Path.Combine(projectDir, "Controllers", "AccountController.cs")); var checkoutControllerText = File.ReadAllText(Path.Combine(projectDir, "Controllers", "CheckoutController.cs")); var shoppingCartControllerText = File.ReadAllText(Path.Combine(projectDir, "Controllers", "ShoppingCartController.cs")); var storeManagerControllerText = File.ReadAllText(Path.Combine(projectDir, "Controllers", "StoreManagerController.cs")); var musicStoreEntitiesText = File.ReadAllText(Path.Combine(projectDir, "Models", "MusicStoreEntities.cs")); var shoppingCartText = File.ReadAllText(Path.Combine(projectDir, "Models", "ShoppingCart.cs")); //Check that namespace was added StringAssert.Contains(@"Microsoft.AspNetCore.Mvc", accountControllerText); //Check that namespace was added StringAssert.Contains(@"Microsoft.AspNetCore.Mvc", checkoutControllerText); //Check that method was replaced StringAssert.Contains(@"HtmlEncoder.Default.Encode", shoppingCartControllerText); //Check that namespaces were added StringAssert.Contains(@"Microsoft.AspNetCore.Mvc", storeManagerControllerText); StringAssert.Contains(@"Microsoft.EntityFrameworkCore", storeManagerControllerText); //Check that namespace was added StringAssert.Contains(@"OnConfiguring", musicStoreEntitiesText); StringAssert.Contains(@"Microsoft.EntityFrameworkCore", musicStoreEntitiesText); //Check that httpcontext is added (with a space) to make sure it's not httpcontextbase StringAssert.Contains(@"HttpContext ", shoppingCartText); //Check that wwwroot dir was created DirectoryAssert.Exists(Path.Combine(projectDir, "wwwroot")); //Check that files have been created FileAssert.Exists(Path.Combine(projectDir, "Startup.cs")); FileAssert.Exists(Path.Combine(projectDir, "Program.cs")); FileAssert.Exists(Path.Combine(projectDir, "appsettings.json")); //Check that package has been added: Assert.True(csProjContent.IndexOf(@"Microsoft.EntityFrameworkCore") > 0); //Check that correct version is used Assert.True(csProjContent.IndexOf(string.Concat(@">", version, "<")) > 0); Assert.True(csProjContent.IndexOf("Newtonsoft.Json") > 0); //Check project actions var mvcProjectActions = results.SolutionRunResult.ProjectResults.First(p => p.ProjectFile.EndsWith("MvcMusicStore.csproj")) .ExecutedActions.First(a => a.Key == "Project").Value; Assert.AreEqual(4, mvcProjectActions.Count); }
public void LibraryPathExists() { DirectoryAssert.Exists(XamarinAndroid.LibraryPath); }
public void PathExists() { DirectoryAssert.Exists(XamarinAndroid.Path); }
public void PlatformDirectory() { string dir = XamarinAndroid.PlatformDirectory; DirectoryAssert.Exists(dir); }
public void DoesNotExistFailsWhenStringIsNull() { var ex = Assert.Throws <ArgumentNullException>(() => DirectoryAssert.DoesNotExist((string)null)); Assert.That(ex.Message, Does.StartWith("The actual value must be a non-null string or DirectoryInfo")); }
public void AreNotEqualPassesIfActualIsNull() { DirectoryAssert.AreNotEqual(null, _goodDir1.Directory); }
public void DoesNotExistFailsWhenStringIsEmpty() { var ex = Assert.Throws <ArgumentException>(() => DirectoryAssert.DoesNotExist(string.Empty)); Assert.That(ex.Message, Does.StartWith("The actual value cannot be an empty string")); }
public void ExistsPassesWhenDirectoryInfoExists() { DirectoryAssert.Exists(_goodDir1.Directory); }
public void Should_create_correct_folder_path() { DirectoryAssert.Exists(@"C:\TestStorage\Contacts"); }
public void ExistsPassesWhenStringExists() { DirectoryAssert.Exists(_goodDir1.ToString()); }
public void AreNotEqualPassesIfExpectedIsNull() { DirectoryAssert.AreNotEqual(_goodDir1.Directory, null); }
public void testDirectories() { DirectoryAssert.DoesNotExist("abcd"); }