public void TestSkipInvalidConfigurationsCase() { string tmpFileName = Path.GetTempFileName(); File.Delete(tmpFileName); string projectFilePath = tmpFileName + ".sln"; string solutionContents = @" Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project('{E24C65DC-7377-472B-9ABA-BC803B73C61A}') = 'C:\solutions\WebSite2\', '..\..\solutions\WebSite2\', '{F90528C4-6989-4D33-AFE8-F53173597CC2}' ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.VirtualPath = '/WebSite2' Debug.AspNetCompiler.PhysicalPath = '..\..\solutions\WebSite2\' Debug.AspNetCompiler.TargetPath = 'PrecompiledWeb\WebSite2\' Debug.AspNetCompiler.Updateable = 'true' Debug.AspNetCompiler.ForceOverwrite = 'true' Debug.AspNetCompiler.FixedNames = 'true' Debug.AspNetCompiler.Debug = 'True' Release.AspNetCompiler.VirtualPath = '/WebSite2' Release.AspNetCompiler.PhysicalPath = '..\..\solutions\WebSite2\' Release.AspNetCompiler.TargetPath = 'PrecompiledWeb\WebSite2\' Release.AspNetCompiler.Updateable = 'true' Release.AspNetCompiler.ForceOverwrite = 'true' Release.AspNetCompiler.FixedNames = 'true' Release.AspNetCompiler.Debug = 'False' VWDPort = '2776' DefaultWebSiteLanguage = 'Visual C#' EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {F90528C4-6989-4D33-AFE8-F53173597CC2}.Debug|Any CPU.ActiveCfg = Debug|.NET {F90528C4-6989-4D33-AFE8-F53173597CC2}.Debug|Any CPU.Build.0 = Debug|.NET EndGlobalSection EndGlobal"; File.WriteAllText(projectFilePath, solutionContents.Replace('\'', '"')); try { MockLogger logger = new MockLogger(); Engine engine = new Engine(); engine.RegisterLogger(logger); Project solutionWrapperProject = new Project(engine); solutionWrapperProject.Load(projectFilePath); solutionWrapperProject.SetProperty("Configuration", "Nonexistent"); solutionWrapperProject.SetProperty("SkipInvalidConfigurations", "true"); solutionWrapperProject.ToolsVersion = "4.0"; // Build should complete successfully even with an invalid solution config if SkipInvalidConfigurations is true Assertion.AssertEquals(true, solutionWrapperProject.Build(null, null)); // We should get the invalid solution configuration warning Assertion.AssertEquals(1, logger.Warnings.Count); BuildWarningEventArgs warning = logger.Warnings[0]; // Don't look at warning.Code here -- it may be null if PseudoLoc has messed // with our resource strings. The code will still be in the log -- it just wouldn't get // pulled out into the code field. logger.AssertLogContains("MSB4126"); // No errors expected Assertion.AssertEquals(0, logger.Errors.Count); } finally { File.Delete(projectFilePath); } }
public void AssertEqualsTestCaseFail() { string actual = "Goodbye JUnit"; Assertion.AssertEquals("should not be equal", expected, actual); }
public void test_GeometryType() { MultiPolygon mp1 = CreateMP1(); Assertion.AssertEquals("GeometryType: ", "MultiPolygon", mp1.GetGeometryType()); }
/// <summary> /// /// </summary> public void TestMoneyBagHash() { MoneyBag equal = new MoneyBag(new Money(12, "CHF"), new Money(7, "USD")); Assertion.AssertEquals(fMB1.GetHashCode(), equal.GetHashCode()); }
public void TestValue() { DataView TestView = new DataView(dataTable); Assertion.AssertEquals("Dv #1", "item 1", TestView [0]["itemId"]); }
protected void Expect(BigInteger actual, BigInteger expected) { Assertion.AssertEquals(Name, expected, actual); }
public void TestEchoStringNotNull() { System.String testString = "abcd"; System.String result = m_testService.EchoString(testString); Assertion.AssertEquals("result", testString, result); }
public void AssertPosInfinityEqualsInfinity() { Assertion.AssertEquals(Double.PositiveInfinity, Double.PositiveInfinity, 0.0); }
public void AssertSingle() { Assertion.AssertEquals((float)1.0, (float)1.0, (float)0.0); }
public void AssertNanEqualsNaNSucceeds() { Assertion.AssertEquals(Double.NaN, Double.NaN, 0.0); }
public void AssertNegInfinityEqualsInfinity() { Assertion.AssertEquals(Double.NegativeInfinity, Double.NegativeInfinity, 0.0); }
public void AssertEqualsNull() { Assertion.AssertEquals(null, null); }
public void CountZero() { BuildPropertyGroup group = new BuildPropertyGroup(); Assertion.AssertEquals(0, group.Count); }
public void TestCount() { DataView TestView = new DataView(dataTable); Assertion.AssertEquals("Dv #3", 5, TestView.Count); }
public void CtorMessage() { InvalidToolsetDefinitionException toolSetException = new InvalidToolsetDefinitionException("Message"); Assertion.AssertEquals("Message", toolSetException.Message); }
public void AssertByte() { Assertion.AssertEquals((byte)1, (byte)1); }
public void CtorMessage_Empty() { InvalidToolsetDefinitionException toolSetException = new InvalidToolsetDefinitionException(String.Empty); Assertion.AssertEquals(String.Empty, toolSetException.Message); }
public void AssertEquals() { Assertion.AssertEquals(expected, expected); }
public void TestEchoIntSeqNull() { int[] arg = null; int[] result = m_testService.EchoSequence(arg); Assertion.AssertEquals("result length", 0, result.Length); }
public void AssertShort() { Assertion.AssertEquals((short)1, (short)1); }
public void TestEchoStringNull() { System.String testString = null; System.String result = m_testService.EchoString(testString); Assertion.AssertEquals("result", String.Empty, result); }
public void IntegerLongComparison() { Assertion.AssertEquals(1, 1L); Assertion.AssertEquals(1L, 1); }
/// <summary> /// /// </summary> public void TestPrint() { Assertion.AssertEquals("[12 CHF]", f12CHF.ToString()); }
public void TestDecode() { Assertion.AssertEquals("Returned incorrect value for hex string", 255L, Int64Helper.Decode( "0xFF")); Assertion.AssertEquals("Returned incorrect value for dec string", -89000L, Int64Helper.Decode( "-89000")); Assertion.AssertEquals("Returned incorrect value for 0 decimal", 0, Int64Helper.Decode("0") ); Assertion.AssertEquals("Returned incorrect value for 0 hex", 0, Int64Helper.Decode("0x0") ); /*Assertion.Assert( * "Returned incorrect value for most negative value decimal", * Int64Helper.Decode("-9223372036854775808") == 0x8000000000000000L); * Assertion.Assert( * "Returned incorrect value for most negative value hex", * Int64Helper.Decode("-0x8000000000000000") == 0x8000000000000000L);*/ Assertion.Assert( "Returned incorrect value for most positive value decimal", Int64Helper.Decode("9223372036854775807") == 0x7fffffffffffffffL); Assertion.Assert( "Returned incorrect value for most positive value hex", Int64Helper.Decode("0x7fffffffffffffff") == 0x7fffffffffffffffL); //Assertion.Assert("Failed for 07654321765432 " + Int64Helper.Decode("07654321765432"), Int64Helper.Decode("07654321765432") // == 07654321765432L); bool exception = false; try { Int64Helper .Decode("999999999999999999999999999999999999999999999999999999"); } catch (Exception e) { // Correct exception = true; } Assertion.Assert("Failed to throw exception for value > ilong", exception); exception = false; try { Int64Helper.Decode("9223372036854775808"); } catch (Exception e) { // Correct exception = true; } Assertion.Assert("Failed to throw exception for MAX_VALUE + 1", exception); exception = false; try { Int64Helper.Decode("-9223372036854775809"); } catch (Exception e) { // Correct exception = true; } Assertion.Assert("Failed to throw exception for MIN_VALUE - 1", exception); exception = false; try { Int64Helper.Decode("0x8000000000000000"); } catch (Exception e) { // Correct exception = true; } Assertion.Assert("Failed to throw exception for hex MAX_VALUE + 1", exception); exception = false; try { Int64Helper.Decode("-0x8000000000000001"); } catch (Exception e) { // Correct exception = true; } Assertion.Assert("Failed to throw exception for hex MIN_VALUE - 1", exception); exception = false; try { Int64Helper.Decode("42325917317067571199"); } catch (Exception e) { // Correct exception = true; } Assertion.Assert("Failed to throw exception for 42325917317067571199", exception); }