public void Copy_NullExpression_Succeeds() { //Arrange ComplexStruct complexStructStub = ComplexStructFactory(); //Act ComplexStruct copy = complexStructStub.Copy(null); //Assert Assert.IsTrue(complexStructStub.DeepEquals(copy)); }
public void Copy_UnaryExpressions_AreIgnoredAndValueIsSet() { //Arrange ComplexStruct complexStructStub = ComplexStructFactory(); //Act ComplexStruct copy = complexStructStub.Copy(cs => (short)(((ComplexStruct)(object)cs).SimpleStruct.Int), MAGIC_INT); //Assert Assert.IsFalse(complexStructStub.DeepEquals(copy)); Assert.AreNotEqual(complexStructStub.SimpleStruct.Int, copy.SimpleStruct.Int); Assert.AreEqual(MAGIC_INT, copy.SimpleStruct.Int); }
public void Copy_DeepExpression_SetsValue() { //Arrange ComplexStruct complexStructStub = ComplexStructFactory(); //Act ComplexStruct copy = complexStructStub.Copy(cs => cs.SimpleStruct.Int, MAGIC_INT); //Assert Assert.IsFalse(complexStructStub.DeepEquals(copy)); Assert.AreNotEqual(complexStructStub.SimpleStruct.Int, copy.SimpleStruct.Int); Assert.AreEqual(MAGIC_INT, copy.SimpleStruct.Int); }
public void Copy_ShallowExpression_SetsValue() { //Arrange ComplexStruct complexStructStub = ComplexStructFactory(); //Act ComplexStruct copy = complexStructStub.Copy(cs => cs.Str, MAGIC_STRING); //Assert Assert.IsFalse(complexStructStub.DeepEquals(copy)); Assert.AreNotEqual(complexStructStub.Str, copy.Str); Assert.AreEqual(MAGIC_STRING, copy.Str); }