NUnit.Framework.Assert.That(ref string, NUnit.Framework.Constraints.IResolveConstraint, string, params object[])

Here are the examples of the csharp api class NUnit.Framework.Assert.That(ref string, NUnit.Framework.Constraints.IResolveConstraint, string, params object[]) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

7 Examples 7

1. Example

Project: NugetCracker
Source File: TestCSharpProject.cs
View license
[Test]
		public void TestAddNoneFile()
		{
			var result = CSharpProject.AddNoneFile(projectXml, "Sample.PluginInterface.nuspec");
			Assert.That<string>(ref result, Is.StringContaining("<None Include=\"Sample.PluginInterface.nuspec\""));
		}

2. Example

Project: NugetCracker
Source File: TestExtensions.cs
View license
[Test]
		public void TestGetElementValue()
		{
			var result1 = nuspecXml.GetElementValue("title", "default");
			Assert.That<string>(ref result1, Is.EqualTo("$title$"));
		}

3. Example

Project: NugetCracker
Source File: TestCSharpProject.cs
View license
[Test]
		public void TestFixPackageReference()
		{
			var result = CSharpProject.FixPackageReference(projectXml, "Sample.PluginInterface", "2.5.7.0", "net35");
			Assert.That<string>(ref result, Is.Not.StringContaining("2.5.6"));
			Assert.That<string>(ref result, Is.StringContaining("<Reference Include=\"Sample.PluginInterface\""));
			Assert.That<string>(ref result, Is.StringContaining(@"<HintPath>..\..\..\packages\Sample.PluginInterface.2.5.7.0\lib\net35"));
		}

4. Example

Project: NugetCracker
Source File: TestCSharpProject.cs
View license
[Test]
		public void TestAdjustElements()
		{
			var result = CSharpProject.AdjustElements(nuspecXml,
				tags: "Unit Testing",
				requireLicenseAcceptance: true,
				projectUrl: "https://github.com/monoman/NugetCracker/wiki/NugetCracker-Project",
				copyright: "Copyright © Klaus Wuestfeld, Rafael 'Monoman' Teixeira 2011",
				licenseUrl: "https://github.com/monoman/NugetCracker/wiki/License:--BSD-simplified",
				iconUrl: null);
			Assert.That<string>(ref result, Is.Not.StringContaining("iconUrl"));
			Assert.That<string>(ref result, Is.StringContaining("<licenseUrl>https://github.com/monoman/NugetCracker/wiki/License:--BSD-simplified</licenseUrl>"));
			Assert.That<string>(ref result, Is.StringContaining("<projectUrl>https://github.com/monoman/NugetCracker/wiki/NugetCracker-Project</projectUrl>"));
			Assert.That<string>(ref result, Is.StringContaining("<copyright>Copyright © Klaus Wuestfeld, Rafael 'Monoman' Teixeira 2011</copyright>"));
			Assert.That<string>(ref result, Is.StringContaining("<tags>Unit Testing</tags>"));
			Assert.That<string>(ref result, Is.StringContaining("<requireLicenseAcceptance>true</requireLicenseAcceptance>"));
		}

5. Example

Project: NugetCracker
Source File: TestCSharpProject.cs
View license
[Test]
		public void TestReplaceProjectByNuget()
		{
			var result = CSharpProject.ReplaceProjectByNuget(projectXml, "UserRepositoryPlugin", "UserRepoPlugin", "v2.0", @"..\..\..\packages");
			Assert.That<string>(ref result, Is.StringContaining("<Reference Include=\"UserRepositoryPlugin\""));
			Assert.That<string>(ref result, Is.StringContaining(@"<HintPath>..\..\..\packages\UserRepositoryPlugin\lib\net20\UserRepoPlugin.dll</HintPath>"));
			Assert.That<string>(ref result, Is.Not.StringContaining(@"<ProjectReference Include=""..\UserRepositoryPlugin\UserRepositoryPlugin.csproj"">"));
			Assert.That<string>(ref result, Is.StringContaining(@"<ProjectReference Include=""..\UserRepositoryPlugin2\UserRepositoryPlugin2.csproj"">"));
		}

6. Example

Project: NugetCracker
Source File: TestExtensions.cs
View license
[Test]
		public void TestRegexReplace()
		{
			var initial = @"  <package id=""SevenZipLib"" version=""4.12.0.1"" />
</packages>";
			var result1 = initial.RegexReplace("<package [^>]*>", "", "(\\s*</packages>)", "<package id=\"Commons.Prevalence\" version=\"1.0\" />");
			var result2 = initial.RegexReplace("<non-package [^>]*>", "", "(\\s*</packages>)", "<package id=\"Commons.Prevalence\" version=\"1.0\" />$1");
			Assert.That<string>(ref result1, Is.Not.StringContaining("SevenZipLib"));
			Assert.That<string>(ref result2, Is.StringContaining("SevenZipLib").And.StringContaining("Commons.Prevalence"));
		}

7. Example

Project: NugetCracker
Source File: TestExtensions.cs
View license
[Test]
		public void TestSetMetadata()
		{
			var result1 = nuspecXml.SetMetadata("title", "A simple test").SetMetadata("owners", null);
			Assert.That<string>(ref result1, Is.StringContaining("<title>A simple test</title>").And.Not.StringContaining("owners"));
			var result2 = nuspecXml.SetMetadata("unknownElement", "someblah");
			Assert.That<string>(ref result2, Is.StringContaining("<unknownElement>someblah</unknownElement>"));
		}