Пример #1
0
        public void Setup()
        {
            FakeDataAccess = MockRepository.GenerateMock<IGoogleTalkDataAccess>();
            Data_access_OnMessage_event = FakeDataAccess.GetEventRaiser(x=>x.OnMessage += null);
            GoogleMessagingService = new GoogleTalkMessagingService(FakeDataAccess);

            Context();
            Because();
        }
Пример #2
0
        public void It_should_never_login_to_the_data_access_layer()
        {
            var fakeDataAccess = new TestGoogleTalkDataAccess();

            var plugin = new GoogleTalkMessagingService(fakeDataAccess);

            plugin.StartReceiving();

            Assert.That(fakeDataAccess.LoginWasRequested, Is.False);
        }
Пример #3
0
 public void Setup()
 {
     GoogleDataAccessLayer = MockRepository.GenerateMock<IGoogleTalkDataAccess>();
     GooglePlugin = new GoogleTalkPlugIn.GoogleTalkMessagingService(GoogleDataAccessLayer);
     GooglePlugin.SetCredentials(
         new Credentials()
             {
                 UserName = "darkxanthos",
                 Password = "",
                 ServiceInformation = GooglePlugin.GetInformation()
             });
     Context();
     Because();
 }
        public void Context()
        {
            MessageToSend = "Just a test tweet";
            Recipient = new Identity(RecipientAddress, ServiceInfo);

            GTalkDataAccess = MockRepository.GenerateStub<IGoogleTalkDataAccess>();
            GTalkDataAccess
                .Stub(x => x.SetAvailableMessage(null))
                .Constraints(Is.Anything())
                .WhenCalled(x => MessageSent = (string)x.Arguments[0]);

            Plugin = new GoogleTalkMessagingService(GTalkDataAccess);
            Plugin.SetCredentials(new Credentials() { UserName = "darkxanthos" });

            Because();
        }