public void Setup() { _ravenDocStore = MockRepository.GenerateStub<IRavenDocStore>(); var mockRavenStore = MockRepository.GenerateStub<IDocumentStore>(); _docSession = MockRepository.GenerateStub<IDocumentSession>(); _ravenDocStore.Expect(r => r.GetStore()).Return(mockRavenStore); _ravenDocStore.Expect(r => r.ConfigurationDatabaseName()).Return("something"); mockRavenStore.Expect(m => m.OpenSession(Arg<string>.Is.Anything)).Return(_docSession); }
public void Setup() { _ravenDocStore = MockRepository.GenerateStub <IRavenDocStore>(); var mockRavenStore = MockRepository.GenerateStub <IDocumentStore>(); _docSession = MockRepository.GenerateStub <IDocumentSession>(); _ravenDocStore.Expect(r => r.GetStore()).Return(mockRavenStore); _ravenDocStore.Expect(r => r.ConfigurationDatabaseName()).Return("something"); mockRavenStore.Expect(m => m.OpenSession(Arg <string> .Is.Anything)).Return(_docSession); }
public TwilioWrapper(IRavenDocStore documentStore) { DocumentStore = documentStore; string accountSid; string authToken; using (var session = DocumentStore.GetStore().OpenSession("Configuration")) { var twilioConfiguration = session.Load<TwilioConfiguration>("TwilioConfig"); if (twilioConfiguration == null) { throw new ArgumentException("Could not find twilio configuration"); } accountSid = twilioConfiguration.AccountSid; authToken = twilioConfiguration.AuthToken; } _restClient = new TwilioRestClient(accountSid, authToken); }
public SmsTechWrapper(IRavenDocStore documentStore) { var smsTechUrl = ConfigurationManager.AppSettings["SMSTechUrl"]; DocumentStore = documentStore; using (var session = DocumentStore.GetStore().OpenSession("Configuration")) { var smsTechConfiguration = session.Load<SmsTechConfiguration>("SmsTechConfig"); if (smsTechConfiguration == null) throw new ArgumentException("Could not find sms tech configuration"); TransmitSmsClient = new TransmitSms.TransmitSmsWrapper(smsTechConfiguration.ApiKey, smsTechConfiguration.ApiSecret, smsTechUrl); /* - ALL FOR CHECKING TRANSMIT SMS NUGET PACKAGE */ var baseUrl = smsTechUrl; var authHeader = string.Format("Basic {0}", Convert.ToBase64String(Encoding.ASCII.GetBytes(string.Format("{0}:{1}", smsTechConfiguration.ApiKey, smsTechConfiguration.ApiSecret)))); RestClient = new RestClient(baseUrl); RestClient.AddDefaultHeader("Authorization", authHeader); RestClient.AddDefaultHeader("Accept", "application/json"); } }
public TwilioWrapper(IRavenDocStore documentStore) { DocumentStore = documentStore; string accountSid; string authToken; using (var session = DocumentStore.GetStore().OpenSession("Configuration")) { var twilioConfiguration = session.Load <TwilioConfiguration>("TwilioConfig"); if (twilioConfiguration == null) { throw new ArgumentException("Could not find twilio configuration"); } accountSid = twilioConfiguration.AccountSid; authToken = twilioConfiguration.AuthToken; } _restClient = new TwilioRestClient(accountSid, authToken); }