예제 #1
0
        public void Get_ReturnsEventDataQueryable()
        {
            // Arrange
            var mockDbSet     = Events.AsQueryable().BuildMockDbSet();
            var mockDbContext = new Mock <IEventDbContext>();

            mockDbContext
            .Setup(db => db.Events)
            .Returns(mockDbSet.Object);

            var eventAccessor = new EventAccessor(mockDbContext.Object);

            // Act
            var actualQueryable = eventAccessor.GetEventsQueryable();

            // Assert
            Assert.NotNull(actualQueryable);
            Assert.IsAssignableFrom <IQueryable <Event> >(actualQueryable);
        }