Ejemplo n.º 1
0
        public void GetById()
        {
            var resultsList = new IQueryableType {
                Id = 1
            };

            var resource = new Mock <IOperationResource>();

            resource.Setup(c => c.GetResourceRecordById(new object[] { "1" }))
            .Returns(resultsList);

            resourceFactoryMock.Setup(c => c.GetResource("conn1", OperationType.read, "table1"))
            .Returns(resource.Object);

            var results = tableOperations.GetById("conn1", "table1", "1");

            Assert.AreEqual(0, loggingService.LogCount);

            Assert.AreEqual(1, ((IQueryableType)results).Id);
            Assert.IsInstanceOfType(results, typeof(object));
            Assert.IsInstanceOfType(results, typeof(IQueryableType));
        }