Inheritance: IServiceInformation
        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();
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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.");
        }
Ejemplo n.º 4
0
        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;
 }
Ejemplo n.º 6
0
 public IMessagingService GetService(ServiceInformation info)
 {
     return _services.FirstOrDefault(service => service.GetInformation().Equals(info));
 }
Ejemplo n.º 7
0
 public bool Equals(ServiceInformation obj)
 {
     return AreEqual(this, obj);
 }
Ejemplo n.º 8
0
 public Identity(string userName, ServiceInformation serviceInformation)
 {
     UserName = userName;
     ServiceInfo = serviceInformation;
 }