示例#1
0
        public void RavenDBDataContext_Constructor_Initialises_IDocumentSession_Field()
        {
            //Arrange
            var mockCache = new Mock<ICacheProvider>();

            //Act
            context = new RavenDBDataContext(connectionStringName, mockCache.Object);

            //Assert
            Assert.IsInstanceOf<IDocumentSession>(Util.GetPrivateMember<RavenDBDataContext, IDocumentSession>(context, "_documentSession"));
        }
示例#2
0
        public void RavenDBDataContext_GetRepository_Returns_Repository()
        {
            //Arrange
            var mockCache = new Mock<ICacheProvider>();
            var context = new RavenDBDataContext(connectionStringName, mockCache.Object);

            //Act
            var repo = context.GetRepository<Dog>();

            //Assert
            Assert.IsInstanceOf<IRepository<Dog>>(repo);
        }