Skip to content

Commit 944ec2c

Browse files
[Refactor ] to use Assert.That
1 parent fe6996c commit 944ec2c

120 files changed

Lines changed: 325 additions & 325 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

SysML2.NET.Tests/Extend/AcceptActionUsageExtensionsTestFixture.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ public class AcceptActionUsageExtensionsTestFixture
3232
[Test]
3333
public void ComputePayloadArgument_ThrowsNotSupportedException()
3434
{
35-
Assert.Throws<NotSupportedException>(() => ((IAcceptActionUsage)null).ComputePayloadArgument());
35+
Assert.That(() => ((IAcceptActionUsage)null).ComputePayloadArgument(), Throws.TypeOf<NotSupportedException>());
3636
}
3737

3838
[Test]
3939
public void ComputePayloadParameter_ThrowsNotSupportedException()
4040
{
41-
Assert.Throws<NotSupportedException>(() => ((IAcceptActionUsage)null).ComputePayloadParameter());
41+
Assert.That(() => ((IAcceptActionUsage)null).ComputePayloadParameter(), Throws.TypeOf<NotSupportedException>());
4242
}
4343

4444
[Test]
4545
public void ComputeReceiverArgument_ThrowsNotSupportedException()
4646
{
47-
Assert.Throws<NotSupportedException>(() => ((IAcceptActionUsage)null).ComputeReceiverArgument());
47+
Assert.That(() => ((IAcceptActionUsage)null).ComputeReceiverArgument(), Throws.TypeOf<NotSupportedException>());
4848
}
4949
}
5050
}

SysML2.NET.Tests/Extend/ActionDefinitionExtensionsTestFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class ActionDefinitionExtensionsTestFixture
3232
[Test]
3333
public void ComputeAction_ThrowsNotSupportedException()
3434
{
35-
Assert.Throws<NotSupportedException>(() => ((IActionDefinition)null).ComputeAction());
35+
Assert.That(() => ((IActionDefinition)null).ComputeAction(), Throws.TypeOf<NotSupportedException>());
3636
}
3737
}
3838
}

SysML2.NET.Tests/Extend/ActionUsageExtensionsTestFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class ActionUsageExtensionsTestFixture
3232
[Test]
3333
public void ComputeActionDefinition_ThrowsNotSupportedException()
3434
{
35-
Assert.Throws<NotSupportedException>(() => ((IActionUsage)null).ComputeActionDefinition());
35+
Assert.That(() => ((IActionUsage)null).ComputeActionDefinition(), Throws.TypeOf<NotSupportedException>());
3636
}
3737
}
3838
}

SysML2.NET.Tests/Extend/ActorMembershipExtensionsTestFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class ActorMembershipExtensionsTestFixture
3232
[Test]
3333
public void ComputeOwnedActorParameter_ThrowsNotSupportedException()
3434
{
35-
Assert.Throws<NotSupportedException>(() => ((IActorMembership)null).ComputeOwnedActorParameter());
35+
Assert.That(() => ((IActorMembership)null).ComputeOwnedActorParameter(), Throws.TypeOf<NotSupportedException>());
3636
}
3737
}
3838
}

SysML2.NET.Tests/Extend/AllocationDefinitionExtensionsTestFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class AllocationDefinitionExtensionsTestFixture
3232
[Test]
3333
public void ComputeAllocation_ThrowsNotSupportedException()
3434
{
35-
Assert.Throws<NotSupportedException>(() => ((IAllocationDefinition)null).ComputeAllocation());
35+
Assert.That(() => ((IAllocationDefinition)null).ComputeAllocation(), Throws.TypeOf<NotSupportedException>());
3636
}
3737
}
3838
}

SysML2.NET.Tests/Extend/AllocationUsageExtensionsTestFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class AllocationUsageExtensionsTestFixture
3232
[Test]
3333
public void ComputeAllocationDefinition_ThrowsNotSupportedException()
3434
{
35-
Assert.Throws<NotSupportedException>(() => ((IAllocationUsage)null).ComputeAllocationDefinition());
35+
Assert.That(() => ((IAllocationUsage)null).ComputeAllocationDefinition(), Throws.TypeOf<NotSupportedException>());
3636
}
3737
}
3838
}

SysML2.NET.Tests/Extend/AnalysisCaseDefinitionExtensionsTestFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class AnalysisCaseDefinitionExtensionsTestFixture
3232
[Test]
3333
public void ComputeResultExpression_ThrowsNotSupportedException()
3434
{
35-
Assert.Throws<NotSupportedException>(() => ((IAnalysisCaseDefinition)null).ComputeResultExpression());
35+
Assert.That(() => ((IAnalysisCaseDefinition)null).ComputeResultExpression(), Throws.TypeOf<NotSupportedException>());
3636
}
3737
}
3838
}

SysML2.NET.Tests/Extend/AnalysisCaseUsageExtensionsTestFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ public class AnalysisCaseUsageExtensionsTestFixture
3232
[Test]
3333
public void ComputeAnalysisCaseDefinition_ThrowsNotSupportedException()
3434
{
35-
Assert.Throws<NotSupportedException>(() => ((IAnalysisCaseUsage)null).ComputeAnalysisCaseDefinition());
35+
Assert.That(() => ((IAnalysisCaseUsage)null).ComputeAnalysisCaseDefinition(), Throws.TypeOf<NotSupportedException>());
3636
}
3737

3838
[Test]
3939
public void ComputeResultExpression_ThrowsNotSupportedException()
4040
{
41-
Assert.Throws<NotSupportedException>(() => ((IAnalysisCaseUsage)null).ComputeResultExpression());
41+
Assert.That(() => ((IAnalysisCaseUsage)null).ComputeResultExpression(), Throws.TypeOf<NotSupportedException>());
4242
}
4343
}
4444
}

SysML2.NET.Tests/Extend/AnnotatingElementExtensionsTestFixture.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,25 @@ public class AnnotatingElementExtensionsTestFixture
3232
[Test]
3333
public void ComputeAnnotatedElement_ThrowsNotSupportedException()
3434
{
35-
Assert.Throws<NotSupportedException>(() => ((IAnnotatingElement)null).ComputeAnnotatedElement());
35+
Assert.That(() => ((IAnnotatingElement)null).ComputeAnnotatedElement(), Throws.TypeOf<NotSupportedException>());
3636
}
3737

3838
[Test]
3939
public void ComputeAnnotation_ThrowsNotSupportedException()
4040
{
41-
Assert.Throws<NotSupportedException>(() => ((IAnnotatingElement)null).ComputeAnnotation());
41+
Assert.That(() => ((IAnnotatingElement)null).ComputeAnnotation(), Throws.TypeOf<NotSupportedException>());
4242
}
4343

4444
[Test]
4545
public void ComputeOwnedAnnotatingRelationship_ThrowsNotSupportedException()
4646
{
47-
Assert.Throws<NotSupportedException>(() => ((IAnnotatingElement)null).ComputeOwnedAnnotatingRelationship());
47+
Assert.That(() => ((IAnnotatingElement)null).ComputeOwnedAnnotatingRelationship(), Throws.TypeOf<NotSupportedException>());
4848
}
4949

5050
[Test]
5151
public void ComputeOwningAnnotatingRelationship_ThrowsNotSupportedException()
5252
{
53-
Assert.Throws<NotSupportedException>(() => ((IAnnotatingElement)null).ComputeOwningAnnotatingRelationship());
53+
Assert.That(() => ((IAnnotatingElement)null).ComputeOwningAnnotatingRelationship(), Throws.TypeOf<NotSupportedException>());
5454
}
5555
}
5656
}

SysML2.NET.Tests/Extend/AnnotationExtensionsTestFixture.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,25 @@ public class AnnotationExtensionsTestFixture
3232
[Test]
3333
public void ComputeAnnotatingElement_ThrowsNotSupportedException()
3434
{
35-
Assert.Throws<NotSupportedException>(() => ((IAnnotation)null).ComputeAnnotatingElement());
35+
Assert.That(() => ((IAnnotation)null).ComputeAnnotatingElement(), Throws.TypeOf<NotSupportedException>());
3636
}
3737

3838
[Test]
3939
public void ComputeOwnedAnnotatingElement_ThrowsNotSupportedException()
4040
{
41-
Assert.Throws<NotSupportedException>(() => ((IAnnotation)null).ComputeOwnedAnnotatingElement());
41+
Assert.That(() => ((IAnnotation)null).ComputeOwnedAnnotatingElement(), Throws.TypeOf<NotSupportedException>());
4242
}
4343

4444
[Test]
4545
public void ComputeOwningAnnotatedElement_ThrowsNotSupportedException()
4646
{
47-
Assert.Throws<NotSupportedException>(() => ((IAnnotation)null).ComputeOwningAnnotatedElement());
47+
Assert.That(() => ((IAnnotation)null).ComputeOwningAnnotatedElement(), Throws.TypeOf<NotSupportedException>());
4848
}
4949

5050
[Test]
5151
public void ComputeOwningAnnotatingElement_ThrowsNotSupportedException()
5252
{
53-
Assert.Throws<NotSupportedException>(() => ((IAnnotation)null).ComputeOwningAnnotatingElement());
53+
Assert.That(() => ((IAnnotation)null).ComputeOwningAnnotatingElement(), Throws.TypeOf<NotSupportedException>());
5454
}
5555
}
5656
}

0 commit comments

Comments
 (0)