public void TestValidate_IdIsEmpty() { AssertHelper.Throws <Warning>(() => { _sample = new IntAggregateRootSample(0); _sample.Validate(); }, "Id"); }
public void TestToString() { _sample = new IntAggregateRootSample { Name = "a" }; Assert.Equal(string.Format("Id:{0},姓名:a", _sample.Id), _sample.ToString()); }
public void Test_ToString() { _sample = new IntAggregateRootSample { Name = "a" }; Assert.Equal($"Id:{_sample.Id},姓名:a", _sample.ToString()); }
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); }
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); }
/// <summary> /// 测试初始化 /// </summary> public IntEntityTest() { _sample = new IntAggregateRootSample(); _sample2 = new IntAggregateRootSample(); }