public void StructVsClassTests_Mutate() { StructIntWrapper structIntWrapper = new StructIntWrapper(); structIntWrapper.MyInt = 1; Mutate(structIntWrapper); ClassIntWrapper classIntWrapper = new ClassIntWrapper(); classIntWrapper.MyInt = 1; Mutate(classIntWrapper); }
public void StructVsClassTests() { StructIntWrapper structIntWrapper = new StructIntWrapper(); structIntWrapper.MyInt = 1; StructIntWrapper structIntWrapper2 = structIntWrapper; structIntWrapper2.MyInt = 2; //What is the value of structIntWrapper.MyInt and value of structIntWrapper.MyInt2? bool areStructIntsEqual = structIntWrapper.MyInt == structIntWrapper2.MyInt; ClassIntWrapper classIntWrapper = new ClassIntWrapper(); classIntWrapper.MyInt = 1; ClassIntWrapper classIntWrapper2 = classIntWrapper; classIntWrapper2.MyInt = 2; //What is the value of classIntWrapper2.myInt and value of classIntWrapper2.myInt? bool areClassIntsEqual = classIntWrapper.MyInt == classIntWrapper2.MyInt; }