public void ShouldBeNull_throws_exception_for_none_null_values() { var value = new Exception(); bool threwException = false; try { value.ShouldBeNull(); } catch (AssertionException) { threwException = true; } Assert.IsTrue(threwException, "Should have triggered an assertion."); }
public static void PackageContainsAFrameworkAssemblyReference(ScenarioDirectory directory, Exception exception) { var scenario = MethodBase.GetCurrentMethod().GetFullName(); "Given a simple script" .f(() => directory = ScenarioDirectory.Create(scenario) .WriteLine("foo.csx", "Console.WriteLine();")); "When I install a package which contains a framework assembly reference" .f(() => ScriptCsExe.Install("FrameworkAssemblyReferencer", directory)); "And I execute the script" .f(() => exception = Record.Exception(() => ScriptCsExe.Run("foo.csx", directory))); "Then there should be no errors" .f(() => exception.ShouldBeNull()); }
public static void PackagesWithDuplicateAssemblies(ScenarioDirectory directory, Exception exception) { var scenario = MethodBase.GetCurrentMethod().GetFullName(); "Given a simple script" .f(() => directory = ScenarioDirectory.Create(scenario) .WriteLine("foo.csx", "Console.WriteLine();")); "When I install a package" .f(() => ScriptCsExe.Install("Duplicate.A", directory)); "And I install another package containing the same assembly" .f(() => ScriptCsExe.Install("Duplicate.B", directory)); "And I execute the script" .f(() => exception = Record.Exception(() => ScriptCsExe.Run("foo.csx", directory))); "Then there should be no errors" .f(() => exception.ShouldBeNull()); }