Browse files

Catch is back in core.

Conflicts:
	Source/Examples/Example.CustomDelegates/AccountSpec.cs
	Source/Examples/Example.NewCustomDelegates/AccountSpec.cs
	Source/Machine.Specifications.Clr4.Specs/TaskSpecificationExtensionsSpecs.cs
	Source/Machine.Specifications.Specs/Runner/SpecificationRunnerSpecs.cs
	Source/Machine.Specifications.Specs/Runner/SpecificationRunnerWithBehaviorSpecs.cs
  • Loading branch information...
1 parent e6b2c96 commit 6f9c34616d9ed0451cd5cffd486ac27d42d15b05 @danielmarbach danielmarbach committed Jan 3, 2014
View
1 Source/Machine.Specifications.Should.Specs/Machine.Specifications.Should.Specs.csproj
@@ -46,7 +46,6 @@
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
<Compile Include="AssertionSpecs.cs" />
- <Compile Include="CatchSpecs.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ShouldBeLikeSpecs.cs" />
<Compile Include="Utility\Internal\ErrorMessageSpecs.cs" />
View
1 Source/Machine.Specifications.Should/Machine.Specifications.Should.csproj
@@ -40,7 +40,6 @@
</Compile>
<Compile Include="Annotations\ReSharperAttributes.cs" />
<Compile Include="AssertComparer.cs" />
- <Compile Include="Catch.cs" />
<Compile Include="ComparerStrategies\ComparableComparer.cs" />
<Compile Include="ComparerStrategies\ComparerFactory.cs" />
<Compile Include="ComparerStrategies\ComparisionResult.cs" />
View
164 ...Specifications.Should.Specs/CatchSpecs.cs → ...achine.Specifications.Specs/CatchSpecs.cs
@@ -1,82 +1,84 @@
-using System;
-
-namespace Machine.Specifications.Should.Specs
-{
- [Subject(typeof(Catch))]
- public class when_calling_Catch_Exception_with_an_Action
- {
- [Subject(typeof(Catch))]
- public class with_a_throwing_Action
- {
- static ArgumentException AnException;
- static Exception Result;
-
- Establish context = () => { AnException = new ArgumentException(); };
-
- Because of = () => { Result = Catch.Exception(() => { throw AnException; }); };
-
- It should_return_the_same_exception =
- () => Result.ShouldBeTheSameAs(AnException);
- }
-
- [Subject(typeof(Catch))]
- public class with_a_non_throwing_Action
- {
- static string ActionSideEffect;
- static Exception Result;
-
- Because of = () => { Result = Catch.Exception(() => { ActionSideEffect = "hi"; }); };
-
- It should_access_the_propety =
- () => ActionSideEffect.ShouldEqual("hi");
-
- It should_return_null =
- () => Result.ShouldBeNull();
- }
- }
-
- [Subject(typeof(Catch))]
- public class when_calling_Catch_Exception_with_a_Func
- {
- class Dummy
- {
- public static readonly ArgumentException AnException = new ArgumentException();
-
- public static string ThrowingProperty
- {
- get { throw AnException; }
- }
-
- public static string NonThrowingProperty
- {
- get { return "hi"; }
- }
- }
-
- [Subject(typeof(Catch))]
- public class with_a_throwing_Func
- {
- static Exception Result;
-
- Because of = () => { Result = Catch.Exception(() => Dummy.ThrowingProperty); };
-
- It should_return_the_same_exception =
- () => Result.ShouldBeTheSameAs(Dummy.AnException);
- }
-
- [Subject(typeof(Catch))]
- public class with_a_non_throwing_Func
- {
- static Exception Result;
- static string PropertyValue;
-
- Because of = () => { Result = Catch.Exception(() => PropertyValue = Dummy.NonThrowingProperty); };
-
- It should_access_the_propety =
- () => PropertyValue.ShouldEqual("hi");
-
- It should_return_null =
- () => Result.ShouldBeNull();
- }
- }
+using System;
+
+using FluentAssertions;
+
+namespace Machine.Specifications.Specs
+{
+ [Subject(typeof(Catch))]
+ public class when_calling_Catch_Exception_with_an_Action
+ {
+ [Subject(typeof(Catch))]
+ public class with_a_throwing_Action
+ {
+ static ArgumentException AnException;
+ static Exception Result;
+
+ Establish context = () => { AnException = new ArgumentException(); };
+
+ Because of = () => { Result = Catch.Exception(() => { throw AnException; }); };
+
+ It should_return_the_same_exception =
+ () => Result.Should().BeSameAs(AnException);
+ }
+
+ [Subject(typeof(Catch))]
+ public class with_a_non_throwing_Action
+ {
+ static string ActionSideEffect;
+ static Exception Result;
+
+ Because of = () => { Result = Catch.Exception(() => { ActionSideEffect = "hi"; }); };
+
+ It should_access_the_propety =
+ () => ActionSideEffect.Should().Be("hi");
+
+ It should_return_null =
+ () => Result.Should().BeNull();
+ }
+ }
+
+ [Subject(typeof(Catch))]
+ public class when_calling_Catch_Exception_with_a_Func
+ {
+ class Dummy
+ {
+ public static readonly ArgumentException AnException = new ArgumentException();
+
+ public static string ThrowingProperty
+ {
+ get { throw AnException; }
+ }
+
+ public static string NonThrowingProperty
+ {
+ get { return "hi"; }
+ }
+ }
+
+ [Subject(typeof(Catch))]
+ public class with_a_throwing_Func
+ {
+ static Exception Result;
+
+ Because of = () => { Result = Catch.Exception(() => Dummy.ThrowingProperty); };
+
+ It should_return_the_same_exception =
+ () => Result.Should().BeSameAs(Dummy.AnException);
+ }
+
+ [Subject(typeof(Catch))]
+ public class with_a_non_throwing_Func
+ {
+ static Exception Result;
+ static string PropertyValue;
+
+ Because of = () => { Result = Catch.Exception(() => PropertyValue = Dummy.NonThrowingProperty); };
+
+ It should_access_the_propety =
+ () => PropertyValue.Should().Be("hi");
+
+ It should_return_null =
+ () => Result.Should().BeNull();
+ }
+ }
}
View
1 Source/Machine.Specifications.Specs/Machine.Specifications.Specs.csproj
@@ -65,6 +65,7 @@
<Compile Include="..\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
+ <Compile Include="CatchSpecs.cs" />
<Compile Include="ExceptionResultSpecs.cs" />
<Compile Include="Explorers\AssemblyExplorerSpecs.cs" />
<Compile Include="Factories\ContextFactorySpecs.cs" />
View
0 ...ce/Machine.Specifications.Should/Catch.cs → Source/Machine.Specifications/Catch.cs
File renamed without changes.
View
1 Source/Machine.Specifications/Machine.Specifications.csproj
@@ -71,6 +71,7 @@
</Compile>
<Compile Include="Annotations\ReSharperAttributes.cs" />
<Compile Include="BehaviorsAttribute.cs" />
+ <Compile Include="Catch.cs" />
<Compile Include="DelegateUsageAttribute.cs" />
<Compile Include="Factories\BehaviorFactory.cs" />
<Compile Include="Factories\ITagExtractor.cs" />

0 comments on commit 6f9c346

Please sign in to comment.