コード例 #1
0
        public void UpdateDeltaGood(string id, string content, string linerange)
        {
            Mock <Delta> deltaDouble2 = new Mock <Delta>();

            deltaDouble2.Setup(delta2 => delta2.FileId).Returns(id);
            deltaDouble2.Setup(delta2 => delta2.Content).Returns(content);
            deltaDouble2.Setup(delta2 => delta2.LineRange).Returns(linerange);

            delta2 = deltaDouble2.Object;
            FakeDBManager fakeDatabase = new FakeDBManager();

            fakeDatabase.AddDelta(delta);

            fakeDatabase.UpdateDelta(delta2);
            Assert.AreEqual(fakeDatabase.GetDelta(delta.FileId).Content, delta2.Content);
            Assert.AreEqual(fakeDatabase.GetDelta(delta.FileId).LineRange, delta2.LineRange);
        }