public void TestAtSaveGemmerDataProxy() { using (IMySqlDataProvider sut = CreateSut()) { Assert.That(sut, Is.Not.Null); int systemNo = _random.Next(90, 99); MyDataProxy mySqlDataProxy = _fixture.Build <MyDataProxy>() .With(m => m.SystemNo, systemNo) .Create(); Assert.That(mySqlDataProxy, Is.Not.Null); Assert.That(mySqlDataProxy.SaveRelationsIsCalled, Is.False); MyDataProxy result = sut.Add(mySqlDataProxy); Assert.That(result, Is.Not.Null); Assert.That(result.SaveRelationsIsCalled, Is.True); Assert.That(result.IsInserting, Is.True); result = sut.Save(mySqlDataProxy); Assert.That(result, Is.Not.Null); Assert.That(result.SaveRelationsIsCalled, Is.True); Assert.That(result.IsInserting, Is.False); sut.Delete(result); } }
public void TestAtSaveKasterArgumenutNullExceptionHvisDataProxyErNull() { using (IMySqlDataProvider sut = CreateSut()) { Assert.That(sut, Is.Not.Null); ArgumentNullException result = Assert.Throws <ArgumentNullException>(() => sut.Save <MyDataProxy>(null)); TestHelper.AssertArgumentNullExceptionIsValid(result, "dataProxy"); } }