private void TestCallPattern(TestOperationPattern pattern, SafeType <Connector> clazz) { Configuration config = new MockConfiguration(false); ConnectorFacadeFactory factory = ConnectorFacadeFactory.GetInstance(); // **test only** APIConfiguration impl = TestHelpers.CreateTestConfiguration(clazz, config); ConnectorFacade facade; facade = factory.NewInstance(impl); // make the call on the connector facade.. pattern.MakeCall(facade); // check the call structure.. IList <MockConnector.Call> calls = MockConnector.GetCallPattern(); // check the call pattern.. Assert.AreEqual("Init", calls[0].MethodName); calls.RemoveAt(0); pattern.CheckCalls(calls); Assert.AreEqual("Dispose", calls[0].MethodName); calls.RemoveAt(0); Assert.IsTrue(calls.Count == 0); }
private void TestCallPattern(TestOperationPattern pattern, SafeType<Connector> clazz) { Configuration config = new MockConfiguration(false); ConnectorFacadeFactory factory = ConnectorFacadeFactory.GetInstance(); // **test only** APIConfiguration impl = TestHelpers.CreateTestConfiguration(clazz, config); ConnectorFacade facade; facade = factory.NewInstance(impl); // make the call on the connector facade.. pattern.MakeCall(facade); // check the call structure.. IList<MockConnector.Call> calls = MockConnector.GetCallPattern(); // check the call pattern.. Assert.AreEqual("Init", calls[0].MethodName); calls.RemoveAt(0); pattern.CheckCalls(calls); Assert.AreEqual("Dispose", calls[0].MethodName); calls.RemoveAt(0); Assert.IsTrue(calls.Count == 0); }
/// <summary> /// Test the pattern of the common operations. /// </summary> private void TestCallPattern(TestOperationPattern pattern) { TestCallPattern(pattern, SafeType <Connector> .Get <MockAllOpsConnector>()); }
/// <summary> /// Test the pattern of the common operations. /// </summary> private void TestCallPattern(TestOperationPattern pattern) { TestCallPattern(pattern, SafeType<Connector>.Get<MockAllOpsConnector>()); }