Beispiel #1
0
        public void ExecuteAsync_nongeneric_calls_Single_by_default()
        {
            var createObjectQueryProviderMock = CreateObjectQueryProviderMock();

            var expectedResult = new object();

            createObjectQueryProviderMock.Setup(m => m.CreateQuery(It.IsAny <Expression>(), It.IsAny <Type>()))
            .Returns(MockHelper.CreateMockObjectQuery(expectedResult).Object);

            var result = createObjectQueryProviderMock.Object.ExecuteAsync(new Mock <Expression>().Object).Result;

            Assert.Same(expectedResult, result);
        }
Beispiel #2
0
        public void ExecuteAsync_generic_calls_Single_by_default()
        {
            var createObjectQueryProviderMock = CreateObjectQueryProviderMock();

            var expectedResult = new object();

            createObjectQueryProviderMock.Setup(m => m.CreateQuery <object>(It.IsAny <Expression>()))
            .Returns(MockHelper.CreateMockObjectQuery(expectedResult).Object);

            var result = ((IDbAsyncQueryProvider)createObjectQueryProviderMock.Object)
                         .ExecuteAsync <object>(new Mock <Expression>().Object, CancellationToken.None).Result;

            Assert.Same(expectedResult, result);
        }