public void TestRabbitGatewaySupportWithJmsTemplate() { var template = new RabbitTemplate(); var test = new List<string>(); var gateway = new TestGateway(test); gateway.RabbitTemplate = template; gateway.AfterPropertiesSet(); Assert.AreEqual(template, gateway.RabbitTemplate, "Correct RabbitTemplate"); Assert.AreEqual(test.Count, 1, "initGateway called"); }
public void A_registered_provider_is_resolvable_by_an_interface_type() { var gateway = new TestGateway(new XmlServiceClient("http://mock.org/service.svc")); var provider = new FactoryProvider(gateway); var resolvedGateway = provider.Resolve <ITestGateway>(); Assert.That(resolvedGateway, Is.Not.Null); var xmlServiceClient = (XmlServiceClient)resolvedGateway.ServiceClient; Assert.That(xmlServiceClient.BaseUri, Is.EqualTo("http://mock.org/service.svc")); }
public void TestRabbitGatewaySupportWithJmsTemplate() { var template = new RabbitTemplate(); var test = new List <string>(); var gateway = new TestGateway(test); gateway.RabbitTemplate = template; gateway.AfterPropertiesSet(); Assert.AreEqual(template, gateway.RabbitTemplate, "Correct RabbitTemplate"); Assert.AreEqual(test.Count, 1, "initGateway called"); }
public void TestRabbitGatewaySupportWithConnectionFactory() { var mockConnectionFactory = new Mock<IConnectionFactory>(); var test = new List<string>(); var gateway = new TestGateway(test); gateway.ConnectionFactory = mockConnectionFactory.Object; gateway.AfterPropertiesSet(); Assert.AreEqual(mockConnectionFactory.Object, gateway.ConnectionFactory, "Correct ConnectionFactory"); Assert.AreEqual(mockConnectionFactory.Object, gateway.RabbitTemplate.ConnectionFactory, "Correct RabbitTemplate"); Assert.AreEqual(test.Count, 1, "initGatway called"); }
public void TestRabbitGatewaySupportWithConnectionFactory() { var mockConnectionFactory = new Mock <IConnectionFactory>(); var test = new List <string>(); var gateway = new TestGateway(test); gateway.ConnectionFactory = mockConnectionFactory.Object; gateway.AfterPropertiesSet(); Assert.AreEqual(mockConnectionFactory.Object, gateway.ConnectionFactory, "Correct ConnectionFactory"); Assert.AreEqual(mockConnectionFactory.Object, gateway.RabbitTemplate.ConnectionFactory, "Correct RabbitTemplate"); Assert.AreEqual(test.Count, 1, "initGatway called"); }
public static PaymentGateway CurrentPaymentProcessor(Store store) { PaymentGateway gateway = null; var sett = store.Settings; gateway = Find(sett.PaymentCreditCardGateway) as PaymentGateway; if (gateway == null) { gateway = new TestGateway(); } var mSett = sett.PaymentSettingsGet(sett.PaymentCreditCardGateway); gateway.BaseSettings.Merge(mSett); return(gateway); }
public ActionResult Contact() { try { var request = new TestGateway { Name = "MVC" }; var gateway = HostContext.AppHost.GetServiceGateway(HostContext.GetCurrentRequest()); var response = gateway.Send(request); //within above call the validator throws exception } catch (WebServiceException ex) { // no longer reaches here if (ex.ResponseStatus.ErrorCode == "NotFound") { return(HttpNotFound()); } throw; } return(View(GetViewModel("Contact"))); }
public void Setup() { _gateway = new TestGateway("server=.;integrated security=sspi;initial catalog=AdventureWorks2012"); //obviously this shouldn't be hard coded! }