コード例 #1
0
        public void ConstructorSuccess(IBrowserView browserView, ISocialNetBotEventService socialNetBotEventService)
        {
            var socialNetAuthorization =
                new SocialNetAuthorization(browserView, socialNetBotEventService);

            Assert.NotNull(socialNetAuthorization);
        }
コード例 #2
0
        public void ExecuteAuthorizeTest(string response)
        {
            var browserViewMock = new Mock <IBrowserView>();
            var socialNetBotEventServiceMock = new Mock <ISocialNetBotEventService>();

            var socialNetAuthorization =
                new SocialNetAuthorization(browserViewMock.Object, socialNetBotEventServiceMock.Object);

            browserViewMock.Setup(x => x.Navigate(It.IsAny <Uri>())).Verifiable();
            socialNetBotEventServiceMock.Setup(x => x.Write(It.IsAny <string>())).Verifiable();
            socialNetBotEventServiceMock.Setup(x => x.Read()).Returns(response);
            var result = socialNetAuthorization.ExecuteAuthorize(new Uri("http://localhost"), "message");

            browserViewMock.Verify();
            Assert.Equal(response, result);
        }