forked from pardahlman/RawRabbit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(pardahlman#65) Serializes Message Type without assembly version etc
- Loading branch information
Marcus Utter
committed
Mar 3, 2016
1 parent
5f54329
commit d7ab8fc
Showing
2 changed files
with
71 additions
and
1 deletion.
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
50 changes: 50 additions & 0 deletions
50
test/RawRabbit.Tests/Common/BasicPropertiesProviderTests.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,50 @@ | ||
using Xunit; | ||
using RawRabbit.Common; | ||
using RawRabbit.Configuration; | ||
|
||
namespace RawRabbit.Tests.Common | ||
{ | ||
public class BasicPropertiesProviderTests | ||
{ | ||
[Fact] | ||
public void Should_Be_Able_To_Get_Type_Property_For_Basic_Type() | ||
{ | ||
/* Setup */ | ||
var provider = new BasicPropertiesProvider(new RawRabbitConfiguration()); | ||
|
||
/* Test */ | ||
var type = provider.GetProperties<First>().Type; | ||
|
||
/* Assert */ | ||
Assert.Equal(expected: "RawRabbit.Tests.Common.First, RawRabbit.Tests", actual: type); | ||
} | ||
|
||
[Fact] | ||
public void Should_Be_Able_To_Get_Type_Property_For_Type_With_Generic_Type_Arguments() | ||
{ | ||
/* Setup */ | ||
var provider = new BasicPropertiesProvider(new RawRabbitConfiguration()); | ||
|
||
/* Test */ | ||
var type = provider.GetProperties<Generic<First, Second>>().Type; | ||
|
||
/* Assert */ | ||
Assert.Equal(expected: "RawRabbit.Tests.Common.Generic`2[[RawRabbit.Tests.Common.First, RawRabbit.Tests],[RawRabbit.Tests.Common.Second, RawRabbit.Tests]], RawRabbit.Tests", actual: type); | ||
} | ||
|
||
private class Generic<TFirst, TSecond> | ||
{ | ||
public TFirst First; | ||
public TSecond Second; | ||
} | ||
|
||
private class First | ||
{ | ||
} | ||
|
||
private class Second | ||
{ | ||
} | ||
|
||
} | ||
} |