public void AssignToSomeMemberAfterDeclaration() { var obj = new SomeClass(); obj.SomeOtherValue = "123"; Console.WriteLine(obj.SomeOtherValue); Assert.IsTrue(obj.SomeValue == "Hello"); Assert.IsTrue(obj.SomeOtherValue != null); Greet(obj.SomeOtherValue); }
public void AccessUninitialisedSomeMember() { var obj = new SomeClass(); Assert.Throws( typeof(SomeNotInitialisedException), () => { Greet(obj.SomeOtherValue); } ); }