示例#1
0
        private static IOptions <SocialNetClientAppConfig> GetOptions()
        {
            var optionsMock = new Mock <IOptions <SocialNetClientAppConfig> >();

            optionsMock.SetupGet(x => x.Value)
            .Returns(SocialNetClientAppConfigMock.Get(2));
            return(optionsMock.Object);
        }
示例#2
0
        public void GetTwitterSocialNetClientTest()
        {
            var optionsMock = new Mock <IOptions <SocialNetClientAppConfig> >();

            optionsMock.SetupGet(x => x.Value)
            .Returns(SocialNetClientAppConfigMock.Get(2));
            var messageSeparatorServiceMock = new Mock <IMessageSeparatorService>();
            var socialNetAuthorizationMock  = new Mock <ISocialNetAuthorization>();

            var socialNetClientFactory = new SocialNetClientFactory(
                optionsMock.Object,
                messageSeparatorServiceMock.Object,
                socialNetAuthorizationMock.Object);

            var result = socialNetClientFactory.GetTwitterSocialNetClient();

            Assert.NotNull(result);
        }