Пример #1
0
 public void TestValidate_IdIsEmpty()
 {
     AssertHelper.Throws <Warning>(() => {
         _sample = new IntAggregateRootSample(0);
         _sample.Validate();
     }, "Id");
 }
Пример #2
0
 public void TestToString()
 {
     _sample = new IntAggregateRootSample {
         Name = "a"
     };
     Assert.Equal(string.Format("Id:{0},姓名:a", _sample.Id), _sample.ToString());
 }
Пример #3
0
 public void Test_ToString()
 {
     _sample = new IntAggregateRootSample {
         Name = "a"
     };
     Assert.Equal($"Id:{_sample.Id},姓名:a", _sample.ToString());
 }
Пример #4
0
 public void TestEquals_Id_Empty()
 {
     _sample  = new IntAggregateRootSample(0);
     _sample2 = new IntAggregateRootSample(1);
     Assert.False(_sample.Equals(_sample2));
     Assert.False(_sample == _sample2);
     Assert.False(_sample2 == _sample);
 }
Пример #5
0
 public void TestEquals_IdEquals()
 {
     _sample  = new IntAggregateRootSample(1);
     _sample2 = new IntAggregateRootSample(1);
     Assert.True(_sample.Equals(_sample2));
     Assert.True(_sample == _sample2);
     Assert.False(_sample != _sample2);
 }
Пример #6
0
 /// <summary>
 /// 测试初始化
 /// </summary>
 public IntEntityTest()
 {
     _sample  = new IntAggregateRootSample();
     _sample2 = new IntAggregateRootSample();
 }