Skip to content

Commit

Permalink
Making all assert ctor's private and the classes sealed. We want user…
Browse files Browse the repository at this point in the history
…s to extend from Assert.That instead and not by creating instances of the Assert class which does not have any instance methods. (#224)
  • Loading branch information
AbhitejJohn authored Jul 12, 2017
1 parent cf5a8b5 commit e3d6e82
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/TestFramework/MSTest.Core/Assertions/Assert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ namespace Microsoft.VisualStudio.TestTools.UnitTesting
/// unit tests. If the condition being tested is not met, an exception
/// is thrown.
/// </summary>
public class Assert
public sealed class Assert
{
private static Assert that;

#region Singleton constructor

private Assert()
{
}

/// <summary>
/// Gets the singleton instance of the Assert functionality.
/// </summary>
Expand Down
6 changes: 5 additions & 1 deletion src/TestFramework/MSTest.Core/Assertions/CollectionAssert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ namespace Microsoft.VisualStudio.TestTools.UnitTesting
/// with collections within unit tests. If the condition being tested is not
/// met, an exception is thrown.
/// </summary>
public class CollectionAssert
public sealed class CollectionAssert
{
private static CollectionAssert that;

#region Singleton constructor

private CollectionAssert()
{
}

/// <summary>
/// Gets the singleton instance of the CollectionAssert functionality.
/// </summary>
Expand Down
6 changes: 5 additions & 1 deletion src/TestFramework/MSTest.Core/Assertions/StringAssert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ namespace Microsoft.VisualStudio.TestTools.UnitTesting
/// <summary>
/// The string assert.
/// </summary>
public class StringAssert
public sealed class StringAssert
{
private static StringAssert that;

#region Singleton constructor

private StringAssert()
{
}

/// <summary>
/// Gets the singleton instance of the CollectionAssert functionality.
/// </summary>
Expand Down

0 comments on commit e3d6e82

Please sign in to comment.