Пример #1
0
        public void ToGetContactCollectionQuery_WhenCalled_ReturnsGetContactCollectionQuery()
        {
            IExportContactCollectionQuery sut = CreateSut();

            IGetContactCollectionQuery result = sut.ToGetContactCollectionQuery();

            Assert.That(result, Is.TypeOf <GetContactCollectionQuery>());
        }
Пример #2
0
        public void ToGetContactCollectionQuery_WhenCalled_ReturnsNotNull()
        {
            IExportContactCollectionQuery sut = CreateSut();

            IGetContactCollectionQuery result = sut.ToGetContactCollectionQuery();

            Assert.That(result, Is.Not.Null);
        }
Пример #3
0
        public void ToGetContactCollectionQuery_WhenCalled_ReturnsGetContactCollectionQueryWithExpiresFromExportContactCollectionQuery()
        {
            DateTime expires = DateTime.Now.AddSeconds(_random.Next(60, 100));
            IExportContactCollectionQuery sut = CreateSut(expires: expires);

            IGetContactCollectionQuery result = sut.ToGetContactCollectionQuery();

            Assert.That(result.Expires, Is.EqualTo(expires));
        }
Пример #4
0
        public void ToGetContactCollectionQuery_WhenCalled_ReturnsGetContactCollectionQueryWithRefreshTokenFromExportContactCollectionQuery()
        {
            string refreshToken = _fixture.Create <string>();
            IExportContactCollectionQuery sut = CreateSut(refreshToken: refreshToken);

            IGetContactCollectionQuery result = sut.ToGetContactCollectionQuery();

            Assert.That(result.RefreshToken, Is.EqualTo(refreshToken));
        }
Пример #5
0
        public void ToGetContactCollectionQuery_WhenCalled_ReturnsGetContactCollectionQueryWithTokenTypeFromExportContactCollectionQuery()
        {
            string tokenType = _fixture.Create <string>();
            IExportContactCollectionQuery sut = CreateSut(tokenType);

            IGetContactCollectionQuery result = sut.ToGetContactCollectionQuery();

            Assert.That(result.TokenType, Is.EqualTo(tokenType));
        }
Пример #6
0
        public async Task QueryAsync_WhenCalled_AssertQueryAsyncWasCalledOnGetContactCollectionQueryHandler()
        {
            QueryHandler sut = CreateSut();

            IGetContactCollectionQuery    getContactCollectionQuery = CreateGetContactCollectionQuery();
            IExportContactCollectionQuery query = CreateExportContactCollectionQuery(getContactCollectionQuery);
            await sut.QueryAsync(query);

            _getContactCollectionQueryHandlerMock.Verify(m => m.QueryAsync(It.Is <IGetContactCollectionQuery>(value => value != null && value == getContactCollectionQuery)), Times.Once);
        }