mirror of https://github.com/abpframework/abp.git
2 changed files with 40 additions and 0 deletions
@ -0,0 +1,33 @@ |
|||
using System; |
|||
using Shouldly; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.TestApp.Domain; |
|||
using Xunit; |
|||
|
|||
namespace Volo.Abp.TestApp.Testing |
|||
{ |
|||
public class HasExtraPropertiesExtensions_Tests |
|||
{ |
|||
[Fact] |
|||
public void Basic_Tests() |
|||
{ |
|||
var city = new City(Guid.NewGuid(), "Adana"); |
|||
|
|||
city.HasProperty("UnknownProperty").ShouldBeFalse(); |
|||
city.GetProperty("UnknownProperty").ShouldBeNull(); |
|||
city.GetProperty<int>("UnknownProperty").ShouldBe(0); |
|||
|
|||
city.SetProperty("IsHot", true); |
|||
city.HasProperty("IsHot").ShouldBeTrue(); |
|||
city.GetProperty<bool>("IsHot").ShouldBeTrue(); |
|||
|
|||
city.SetProperty("IsHot", false); |
|||
city.HasProperty("IsHot").ShouldBeTrue(); |
|||
city.GetProperty<bool>("IsHot").ShouldBeFalse(); |
|||
|
|||
city.RemoveProperty("IsHot"); |
|||
city.HasProperty("IsHot").ShouldBeFalse(); |
|||
city.GetProperty<bool>("IsHot").ShouldBeFalse(); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue