public void Setup() { var serviceInfo = new ServiceInformation() { ServiceID = Guid.NewGuid(), ServiceName = "test service" }; ServiceManager = new FakeMessagingService(serviceInfo); TheContactProvider = new ContactProvider(); TheContactProvider.Add(new Contact() { Name = "Justin Bozonier", ContactId = Guid.NewGuid(), Identities = new[]{new Identity("darkxanthos", serviceInfo)} }); ObjectFactory.Initialize(x => { x.ForRequestedType<MainView>().TheDefaultIsConcreteType<MainView>(); x.ForRequestedType<IInteractionContext>().TheDefaultIsConcreteType<TestingInterface>(); x.ForRequestedType<IMessagingServiceManager>().TheDefault.IsThis(ServiceManager); x.ForRequestedType<IContactProvider>().TheDefault.IsThis(TheContactProvider); }); ViewModel = ObjectFactory.GetInstance<MainView>(); Context(); Because(); }
public void AuthenticationFailed(ServiceInformation serviceInfo) { var result = MessageBox.Show("Username and/or password are not correct. Retry?", "Alloy by Justin Bozonier", MessageBoxButton.YesNo); if (result == MessageBoxResult.Yes) CredentialsRequested(serviceInfo); else _CredentialsRetryObserver.StopRetrying(serviceInfo); }
public IMessagingService GetService(ServiceInformation info) { if(Services == null) throw new NullReferenceException("This service provider has a null collection of services. You should NEVER have this issue."); foreach (var service in Services) { if(service.GetInformation().Equals(info)) return service; } throw new InvalidOperationException("The requested service does not exist. You should NEVER see this."); }
public TwitterUtilities(ITwitterDataAccess dataAccess) { // .NET Twitter fix for HTTP Error 417 with Twitter ServicePointManager.Expect100Continue = false; _DataAccess = dataAccess; //testing path _ServiceInformation = new ServiceInformation() { ServiceID = SERVICE_ID, ServiceName = SERVICE_NAME }; if (dataAccess == null) //default path _DataAccess = new TwitterDataAccess(); _ReceivedTweets = new Dictionary<long, bool>(); }
public FakeMessagingService(ServiceInformation info) { _Information = info; }
public IMessagingService GetService(ServiceInformation info) { return _services.FirstOrDefault(service => service.GetInformation().Equals(info)); }
public bool Equals(ServiceInformation obj) { return AreEqual(this, obj); }
public Identity(string userName, ServiceInformation serviceInformation) { UserName = userName; ServiceInfo = serviceInformation; }