public void TestDelete_Positive()
        {
            //Arrange
            var mockSet = new Mock <DbSet <Node> >();

            mockSet.As <IQueryable <Node> >().Setup(m => m.Provider).Returns(_data.Provider);
            mockSet.As <IQueryable <Node> >().Setup(m => m.Expression).Returns(_data.Expression);
            mockSet.As <IQueryable <Node> >().Setup(m => m.ElementType).Returns(_data.ElementType);
            mockSet.As <IQueryable <Node> >().Setup(m => m.GetEnumerator()).Returns(_data.GetEnumerator());
            mockSet.Setup(m => m.Find(It.IsAny <int>())).Returns(_data.First());

            var mockDb = new Mock <IMassiveInteractiveGraphDbEntities>();

            mockDb.Setup(c => c.Nodes).Returns(mockSet.Object);

            var mockDbLog = new Mock <ILog>();

            var nodeDal = new NodeDal(mockDb.Object, mockDbLog.Object);

            //Act
            nodeDal.Delete(1);
            nodeDal.Save();

            //Assert
            mockSet.Verify(m => m.Remove(It.IsAny <Node>()), Times.Once());
            mockDb.Verify(m => m.SaveChanges(), Times.Once());
        }
        public void TestAdd_Positive()
        {
            //Arrange
            var mockSet = new Mock <DbSet <Node> >();

            var mockDb = new Mock <IMassiveInteractiveGraphDbEntities>();

            mockDb.Setup(c => c.Nodes).Returns(mockSet.Object);

            var mockDbLog = new Mock <ILog>();

            var nodeDal = new NodeDal(mockDb.Object, mockDbLog.Object);

            //Act
            nodeDal.AddOrEdit(new Node()
            {
                Label = "label4", Id = 4
            });
            nodeDal.Save();

            //Assert
            mockSet.Verify(m => m.Add(It.IsAny <Node>()), Times.Once());
            mockDb.Verify(m => m.SaveChanges(), Times.Once());
        }