public void PropertyContainer_Construct_NullSrcContainerShouldGiveUnderstandableErrorMessage() { var src = (CustomDataFoo)null; var dst = new CustomDataFoo(); var ex = Assert.Throws <ArgumentNullException>(() => PropertyContainer.Construct(ref dst, ref src)); Assert.That(ex.ParamName, Is.EqualTo("srcContainer")); Assert.That(ex.Message, Is.EqualTo("Value cannot be null." + Environment.NewLine + "Parameter name: srcContainer")); }
public void PropertyContainer_Transfer_NullDstContainerShouldGiveUnderstandableErrorMessage() { var src = new CustomDataFoo(); CustomDataFoo dst = null; var ex = Assert.Throws <ArgumentNullException>(() => PropertyContainer.Transfer(dst, src)); Assert.That(ex.ParamName, Is.EqualTo("dstContainer")); Assert.That(ex.Message, Is.EqualTo("Value cannot be null." + Environment.NewLine + "Parameter name: dstContainer")); }
public void ShouldGiveUnderstandableErrorMessageWhenPassingNullDestinationByRef() { var src = new CustomDataFoo(); CustomDataFoo dst = null; var ex = Assert.Throws <ArgumentNullException>(() => PropertyContainer.Transfer(ref dst, ref src)); Assert.That(ex.ParamName, Is.EqualTo("destination")); Assert.That(ex.Message, Is.EqualTo("Value cannot be null." + Environment.NewLine + "Parameter name: destination")); }