示例#1
0
        public void FormServiceGetListShouldReturnListOfForms()
        {
            // Arrange
            var unitOfWorkMock = new Mock<IUnitOfWork>(MockBehavior.Strict);
            var expectedData = this.GetSampleData().OrderBy(f => f.Title).ToArray();
            unitOfWorkMock.Setup(u => u.Query<Form>()).Returns(expectedData.AsQueryable());
            var service = new FormService(unitOfWorkMock.Object);

            // Act
            var actual = service.GetList();
            CollectionAssert.AreEqual(expectedData, actual);
        }