public void GetManagerActionRecordsShouldReturnCorrectNumberOfRecords()
 {
     var mock = new EntityServiceManagerMock();
     var platformHelperMock = _mocks.First(m => m.GetType().Equals(typeof(Mock<IPlatformHelper>))) as Mock<IPlatformHelper>;
     var entityHelperMock = _mocks.First(m => m.GetType().Equals(typeof(Mock<IEntityHelper>))) as Mock<IEntityHelper>;
     StrixCms.SetHelper(new DefaultPlatformHelper(null));
     var entityHelper = new DefaultEntityHelper(entityTypes);
     EntityHelper.SetHelper(entityHelper);
     var result = mock.EntityServiceManager.GetManagerActionRecords();
     StrixCms.SetHelper(platformHelperMock.Object);
     EntityHelper.SetHelper(entityHelperMock.Object);
     Assert.IsNotNull(result);
     Assert.AreEqual(5, result.Count);
     Assert.AreEqual(10, result.First().Item3.Count);
 }
示例#2
0
        public void GetManagerActionRecordsShouldReturnCorrectNumberOfRecords()
        {
            var mock = new EntityServiceManagerMock();
            var platformHelperMock = _mocks.First(m => m.GetType().Equals(typeof(Mock <IPlatformHelper>))) as Mock <IPlatformHelper>;
            var entityHelperMock   = _mocks.First(m => m.GetType().Equals(typeof(Mock <IEntityHelper>))) as Mock <IEntityHelper>;

            StrixCms.SetHelper(new DefaultPlatformHelper(null));
            var entityHelper = new DefaultEntityHelper(entityTypes);

            EntityHelper.SetHelper(entityHelper);
            var result = mock.EntityServiceManager.GetManagerActionRecords();

            StrixCms.SetHelper(platformHelperMock.Object);
            EntityHelper.SetHelper(entityHelperMock.Object);
            Assert.IsNotNull(result);
            Assert.AreEqual(5, result.Count);
            Assert.AreEqual(10, result.First().Item3.Count);
        }