-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lukas Gerbenis
committed
Oct 1, 2015
1 parent
78c61d2
commit e6284d3
Showing
16 changed files
with
221 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletions
9
vNext/test/BetterModules.Core.Tests/Events/SingleItemEventArgsTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
using BetterModules.Events; | ||
using NUnit.Framework; | ||
using Xunit; | ||
|
||
namespace BetterModules.Core.Tests.Events | ||
{ | ||
[TestFixture] | ||
public class SingleItemEventArgsTests : TestBase | ||
public class SingleItemEventArgsTests | ||
{ | ||
[Test] | ||
[Fact] | ||
public void Should_Assign_Correct_Single_Event_Arg() | ||
{ | ||
var args = new SingleItemEventArgs<int>(13); | ||
|
||
Assert.AreEqual(args.Item, 13); | ||
Assert.Equal(args.Item, 13); | ||
} | ||
} | ||
} |
31 changes: 15 additions & 16 deletions
31
vNext/test/BetterModules.Core.Tests/Exceptions/DataTier/ConcurrentDataExceptionTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,47 @@ | ||
using System; | ||
using BetterModules.Core.Exceptions.DataTier; | ||
using BetterModules.Sample.Module.Models; | ||
using NUnit.Framework; | ||
using Xunit; | ||
|
||
namespace BetterModules.Core.Tests.Exceptions.DataTier | ||
{ | ||
[TestFixture] | ||
public class ConcurrentDataExceptionTests | ||
{ | ||
private const string Message = "TestExcMessage"; | ||
|
||
[Test] | ||
[Fact] | ||
public void Should_Create_Exception_With_Message() | ||
{ | ||
var exception = new ConcurrentDataException(Message); | ||
|
||
Assert.AreEqual(exception.Message, Message); | ||
Assert.IsNull(exception.InnerException); | ||
Assert.IsNull(exception.StaleEntity); | ||
Assert.Equal(exception.Message, Message); | ||
Assert.Null(exception.InnerException); | ||
Assert.Null(exception.StaleEntity); | ||
} | ||
|
||
[Test] | ||
[Fact] | ||
public void Should_Create_Exception_With_Message_And_InnerException() | ||
{ | ||
var innerException = new Exception(Message); | ||
var exception = new ConcurrentDataException(Message, innerException); | ||
|
||
Assert.AreEqual(exception.Message, Message); | ||
Assert.AreEqual(exception.InnerException, innerException); | ||
Assert.IsNull(exception.StaleEntity); | ||
Assert.Equal(exception.Message, Message); | ||
Assert.Equal(exception.InnerException, innerException); | ||
Assert.Null(exception.StaleEntity); | ||
} | ||
|
||
[Test] | ||
[Fact] | ||
public void Should_Create_Exception_With_Stale_Entity() | ||
{ | ||
var guid = Guid.NewGuid(); | ||
var entity = new TestItemModel { Id = guid }; | ||
var exception = new ConcurrentDataException(entity); | ||
|
||
Assert.IsNotNull(exception.Message); | ||
Assert.IsTrue(exception.Message.Contains(guid.ToString())); | ||
Assert.IsTrue(exception.Message.Contains("TestItemModel")); | ||
Assert.AreEqual(exception.StaleEntity, entity); | ||
Assert.IsNull(exception.InnerException); | ||
Assert.NotNull(exception.Message); | ||
Assert.True(exception.Message.Contains(guid.ToString())); | ||
Assert.True(exception.Message.Contains("TestItemModel")); | ||
Assert.Equal(exception.StaleEntity, entity); | ||
Assert.Null(exception.InnerException); | ||
} | ||
} | ||
} |
Oops, something went wrong.