public void Test(PropertyEnsuresInference p) { Contract.Requires(p != null); if (p.IsConnected) { // Use the contract Contract.Assert(p.m_pipe != null); } }
public void TestWithInferredContract(PropertyEnsuresInference p) { Contract.Requires(p != null); if (p.IsConnectedWithInferredContract) { Contract.Assert(p.m_pipe != null); Contract.Assert(p.m_pipe.IsConnected); Contract.Assert(p.m_pipe.RandomBit); // Should not prove this one } }
public void TestWithInferredContract(PropertyEnsuresInference p) { Contract.Requires(p != null); if(p.IsConnectedWithInferredContract) { Contract.Assert(p.m_pipe != null); Contract.Assert(p.m_pipe.IsConnected); Contract.Assert(p.m_pipe.RandomBit); // Should not prove this one } }
public void Test(PropertyEnsuresInference p) { Contract.Requires(p != null); if(p.IsConnected) { // Use the contract Contract.Assert(p.m_pipe != null); } }