@ -22,17 +22,17 @@ namespace ZeroMappingTest
Assert . True ( mapper . Exists ( "Title" ) ) ;
Assert . True ( mapper . Exists ( "Title" ) ) ;
Assert . True ( mapper . Exists ( "Description" ) ) ;
Assert . True ( mapper . Exists ( "Description" ) ) ;
Assert . True( list . Contains ( "Id" ) ) ;
Assert . Contains< string > ( list , s = > s . Equals ( "Id" , StringComparison . Ordinal ) ) ;
Assert . True( list . Contains ( "Title" ) ) ;
Assert . Contains< string > ( list , s = > s . Equals ( "Title" , StringComparison . Ordinal ) ) ;
Assert . True( list . Contains ( "Description" ) ) ;
Assert . Contains< string > ( list , s = > s . Equals ( "Description" , StringComparison . Ordinal ) ) ;
Assert . False ( mapper . Exists ( "Version" ) ) ;
Assert . False ( mapper . Exists ( "Version" ) ) ;
Assert . False ( mapper . Exists ( "Created" ) ) ;
Assert . False ( mapper . Exists ( "Created" ) ) ;
Assert . False( list . Contains ( "Version" ) ) ;
Assert . DoesNotContain< string > ( list , s = > s . Equals ( "Version" , StringComparison . Ordinal ) ) ;
Assert . False( list . Contains ( "Created" ) ) ;
Assert . DoesNotContain< string > ( list , s = > s . Equals ( "Created" , StringComparison . Ordinal ) ) ;
Assert . Equal ( mapper . EntityType , typeof ( BaseClass ) ) ;
Assert . Equal ( typeof ( BaseClass ) , mapper . EntityType ) ;
}
}
[Fact]
[Fact]
@ -52,23 +52,23 @@ namespace ZeroMappingTest
Assert . True ( mapper . Exists ( "ReadOnlyProperty" ) ) ;
Assert . True ( mapper . Exists ( "ReadOnlyProperty" ) ) ;
Assert . True ( mapper . Exists ( "WriteOnlyProperty" ) ) ;
Assert . True ( mapper . Exists ( "WriteOnlyProperty" ) ) ;
Assert . True( list . Contains ( "Id" ) ) ;
Assert . Contains< string > ( list , s = > s . Equals ( "Id" , StringComparison . Ordinal ) ) ;
Assert . True( list . Contains ( "Title" ) ) ;
Assert . Contains< string > ( list , s = > s . Equals ( "Title" , StringComparison . Ordinal ) ) ;
Assert . True( list . Contains ( "Description" ) ) ;
Assert . Contains< string > ( list , s = > s . Equals ( "Description" , StringComparison . Ordinal ) ) ;
Assert . True( list . Contains ( "Number" ) ) ;
Assert . Contains< string > ( list , s = > s . Equals ( "Number" , StringComparison . Ordinal ) ) ;
Assert . True( list . Contains ( "Balance" ) ) ;
Assert . Contains< string > ( list , s = > s . Equals ( "Balance" , StringComparison . Ordinal ) ) ;
Assert . True( list . Contains ( "ReadOnlyProperty" ) ) ;
Assert . Contains< string > ( list , s = > s . Equals ( "ReadOnlyProperty" , StringComparison . Ordinal ) ) ;
Assert . True( list . Contains ( "WriteOnlyProperty" ) ) ;
Assert . Contains< string > ( list , s = > s . Equals ( "WriteOnlyProperty" , StringComparison . Ordinal ) ) ;
Assert . False ( mapper . Exists ( "HiddenField" ) ) ;
Assert . False ( mapper . Exists ( "HiddenField" ) ) ;
Assert . False ( mapper . Exists ( "Version" ) ) ;
Assert . False ( mapper . Exists ( "Version" ) ) ;
Assert . False ( mapper . Exists ( "Created" ) ) ;
Assert . False ( mapper . Exists ( "Created" ) ) ;
Assert . False( list . Contains ( "HiddenField" ) ) ;
Assert . DoesNotContain< string > ( list , s = > s . Equals ( "HiddenField" , StringComparison . Ordinal ) ) ;
Assert . False( list . Contains ( "Version" ) ) ;
Assert . DoesNotContain< string > ( list , s = > s . Equals ( "Version" , StringComparison . Ordinal ) ) ;
Assert . False( list . Contains ( "Created" ) ) ;
Assert . DoesNotContain< string > ( list , s = > s . Equals ( "Created" , StringComparison . Ordinal ) ) ;
Assert . Equal ( mapper . EntityType , typeof ( ChildClass ) ) ;
Assert . Equal ( typeof ( ChildClass ) , mapper . EntityType ) ;
}
}
[Fact]
[Fact]
@ -93,13 +93,13 @@ namespace ZeroMappingTest
mapper . Set ( instance , "Title" , title ) ;
mapper . Set ( instance , "Title" , title ) ;
mapper . Set ( instance , "Description" , description ) ;
mapper . Set ( instance , "Description" , description ) ;
// Assert
// Assert
Assert . Equal < Guid > ( mapper. Get < Guid > ( instance , "Id" ) , id ) ;
Assert . Equal < Guid > ( id, mapper. Get < Guid > ( instance , "Id" ) ) ;
Assert . Equal <string > ( mapper . Get < string > ( instance , "Title" ) , title ) ;
Assert . Equal (title , mapper . Get < string > ( instance , "Title" ) ) ;
Assert . Equal <string > ( mapper . Get < string > ( instance , "Description" ) , description ) ;
Assert . Equal (description , mapper . Get < string > ( instance , "Description" ) ) ;
Assert . Equal ( mapper. Get ( instance , "Id" ) , id ) ;
Assert . Equal ( id, mapper. Get ( instance , "Id" ) ) ;
Assert . Equal ( mapper. Get ( instance , "Title" ) , title ) ;
Assert . Equal ( title, mapper. Get ( instance , "Title" ) ) ;
Assert . Equal ( mapper. Get ( instance , "Description" ) , description ) ;
Assert . Equal ( description, mapper. Get ( instance , "Description" ) ) ;
try
try
{
{
@ -140,8 +140,8 @@ namespace ZeroMappingTest
mapper . Set ( instance , "Balance" , balance ) ;
mapper . Set ( instance , "Balance" , balance ) ;
// Assert
// Assert
Assert . Equal < Guid > ( mapper . Get < Guid > ( instance , "Id" ) , id ) ;
Assert . Equal < Guid > ( mapper . Get < Guid > ( instance , "Id" ) , id ) ;
Assert . Equal <string > (mapper . Get < string > ( instance , "Title" ) , title ) ;
Assert . Equal (mapper . Get < string > ( instance , "Title" ) , title ) ;
Assert . Equal <string > (mapper . Get < string > ( instance , "Description" ) , description ) ;
Assert . Equal (mapper . Get < string > ( instance , "Description" ) , description ) ;
Assert . Equal < int > ( mapper . Get < int > ( instance , "Number" ) , number ) ;
Assert . Equal < int > ( mapper . Get < int > ( instance , "Number" ) , number ) ;
Assert . Equal < int > ( mapper . Get < int > ( instance , "Balance" ) , balance ) ;
Assert . Equal < int > ( mapper . Get < int > ( instance , "Balance" ) , balance ) ;
@ -214,15 +214,15 @@ namespace ZeroMappingTest
var obj = new PocoFields { Id = 1000 , Date = date , Title = "Caption" } ;
var obj = new PocoFields { Id = 1000 , Date = date , Title = "Caption" } ;
// Assert
// Assert
Assert . Equal ( mapper . EntityType , typeof ( PocoFields ) ) ;
Assert . Equal ( typeof ( PocoFields ) , mapper . EntityType ) ;
Assert . True ( mapper . Exists ( "Id" ) ) ;
Assert . True ( mapper . Exists ( "Id" ) ) ;
Assert . True ( mapper . Exists ( "Date" ) ) ;
Assert . True ( mapper . Exists ( "Date" ) ) ;
Assert . True ( mapper . Exists ( "Title" ) ) ;
Assert . True ( mapper . Exists ( "Title" ) ) ;
Assert . Equal ( mapper . Get ( obj , "Id" ) , ( long ) 1000 ) ;
Assert . Equal ( ( long ) 1000 , mapper . Get ( obj , "Id" ) ) ;
Assert . Equal ( mapper. Get ( obj , "Date" ) , date ) ;
Assert . Equal ( date, mapper. Get ( obj , "Date" ) ) ;
Assert . Equal ( mapper . Get ( obj , "Title" ) , "Caption" ) ;
Assert . Equal ( "Caption" , mapper . Get ( obj , "Title" ) ) ;
mapper . Set ( obj , "Id" , 1001 ) ;
mapper . Set ( obj , "Id" , 1001 ) ;
Assert . Equal ( mapper . Get ( obj , "Id" ) , ( long ) 1001 ) ;
Assert . Equal ( mapper . Get ( obj , "Id" ) , ( long ) 1001 ) ;
@ -237,15 +237,15 @@ namespace ZeroMappingTest
var obj = new PocoProperties { Id = 1000 , Date = date , Title = "Caption" } ;
var obj = new PocoProperties { Id = 1000 , Date = date , Title = "Caption" } ;
// Assert
// Assert
Assert . Equal ( mapper . EntityType , typeof ( PocoProperties ) ) ;
Assert . Equal ( typeof ( PocoProperties ) , mapper . EntityType ) ;
Assert . True ( mapper . Exists ( "Id" ) ) ;
Assert . True ( mapper . Exists ( "Id" ) ) ;
Assert . True ( mapper . Exists ( "Date" ) ) ;
Assert . True ( mapper . Exists ( "Date" ) ) ;
Assert . True ( mapper . Exists ( "Title" ) ) ;
Assert . True ( mapper . Exists ( "Title" ) ) ;
Assert . Equal ( mapper . Get ( obj , "Id" ) , ( long ) 1000 ) ;
Assert . Equal ( ( long ) 1000 , mapper . Get ( obj , "Id" ) ) ;
Assert . Equal ( mapper. Get ( obj , "Date" ) , date ) ;
Assert . Equal ( date, mapper. Get ( obj , "Date" ) ) ;
Assert . Equal ( mapper . Get ( obj , "Title" ) , "Caption" ) ;
Assert . Equal ( "Caption" , mapper . Get ( obj , "Title" ) ) ;
mapper . Set ( obj , "Id" , 1001 ) ;
mapper . Set ( obj , "Id" , 1001 ) ;
Assert . Equal ( mapper . Get ( obj , "Id" ) , ( long ) 1001 ) ;
Assert . Equal ( mapper . Get ( obj , "Id" ) , ( long ) 1001 ) ;