public void CanCallOverloadConstructor() { var stub = new StubExampleClass(3); ExampleClass example = stub; Assert.Equal(3, example.CallsToMethod); }
public void ProtectedFieldUsage() { var stub = new StubExampleClass(); stub.sampleField = 7; Assert.Equal(7, stub.sampleField); }
public void ProtectedMethodUsage() { var stub = new StubExampleClass(); ExampleClass example = stub; stub.MethodToCall2(); Assert.Equal(1, example.CallsToMethod); }
public void CanCallConstructorWithSubclassParameters() { var stub1 = new StubExampleClass("bob"); StubExampleClass stub2; using (StubExampleClass.DeferConstruction("tommy", out stub2)) { } ExampleClass example = stub1; Assert.Equal(3, example.CallsToMethod); // length of 'bob' example = stub2; Assert.Equal(5, example.CallsToMethod); // length of 'tommy' }