public void CopyUnchangedValues_UnRelatedType_Throws_InvalidOp() { // Arrange Delta <Base> delta = new Delta <Base>(typeof(Derived)); AnotherDerived unrelatedEntity = new AnotherDerived(); // Act & Assert Assert.Throws <InvalidOperationException>( () => delta.CopyUnchangedValues(unrelatedEntity), "Cannot use Delta of type 'System.Web.Http.OData.DeltaTest+Derived' on an entity of type 'System.Web.Http.OData.DeltaTest+AnotherDerived'."); }
public void CopyUnchangedValues_UnRelatedType_Throws_Argument() { // Arrange Delta <Base> delta = new Delta <Base>(typeof(Derived)); AnotherDerived unrelatedEntity = new AnotherDerived(); // Act & Assert Assert.ThrowsArgument( () => delta.CopyUnchangedValues(unrelatedEntity), "original", "Cannot use Delta of type 'System.Web.Http.OData.DeltaTest+Derived' on an entity of type 'System.Web.Http.OData.DeltaTest+AnotherDerived'."); }
public void CopyUnchangedValues_UnRelatedType_Throws_InvalidOp() { // Arrange Delta<Base> delta = new Delta<Base>(typeof(Derived)); AnotherDerived unrelatedEntity = new AnotherDerived(); // Act & Assert Assert.Throws<InvalidOperationException>( () => delta.CopyUnchangedValues(unrelatedEntity), "Cannot use Delta of type 'System.Web.Http.OData.DeltaTest+Derived' on an entity of type 'System.Web.Http.OData.DeltaTest+AnotherDerived'."); }