-
Notifications
You must be signed in to change notification settings - Fork 18
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
Michel van Os
committed
Oct 13, 2016
1 parent
df44e89
commit 55aa866
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
Source/MoreDotNet.Test/Extensions/Common/XmlExtensions/XmlExtensionsTests.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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
namespace MoreDotNet.Tests.Extensions.Common.XmlExtensions | ||
{ | ||
using System; | ||
|
||
using MoreDotNet.Extensions.Common; | ||
|
||
using Xunit; | ||
|
||
public class XmlExtensionsTests | ||
{ | ||
[Fact] | ||
public void XmlSerialize_GivenNullArgument_ShouldThrowException() | ||
{ | ||
object testObject = null; | ||
|
||
Assert.Throws<ArgumentNullException>(() => testObject.XmlSerialize()); | ||
} | ||
|
||
[Fact] | ||
public void XmlSerialize_GivenNonNullArgument_ShouldReturnSerialized() | ||
{ | ||
object testObject = new object(); | ||
|
||
Assert.NotNull(testObject.XmlSerialize()); | ||
} | ||
|
||
[Fact] | ||
public void XmlDeserialize_GivenNullArgument_ShouldThrowException() | ||
{ | ||
string testSerializedObject = null; | ||
|
||
Assert.Throws<ArgumentNullException>(() => testSerializedObject.XmlDeserialize<object>()); | ||
} | ||
|
||
[Fact] | ||
public void XmlDeserialize_GivenNonNullArgument_ShouldReturnDeserialized() | ||
{ | ||
object testObject = new object(); | ||
string testSerializedObject = testObject.XmlSerialize(); | ||
|
||
Assert.NotNull(testSerializedObject.XmlDeserialize<object>()); | ||
} | ||
} | ||
} |
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