Esempio n. 1
0
 public void Formats()
 {
     var mockPath = MockRepository.GenerateStub<IXmlPathStrict>();
     mockPath.Stub(x => x.ToString()).Return("All paths lead to Roma");
     var diff = new Diff(DiffType.MissingElement, mockPath, DiffTargets.Both);
     Assert.AreEqual("Missing element at 'All paths lead to Roma'.", diff.ToString());
 }
Esempio n. 2
0
 public void Constructs_ok()
 {
     var mockPath = MockRepository.GenerateStub<IXmlPathStrict>();
     var diff = new Diff(DiffType.MissingElement, mockPath, DiffTargets.Both);
     Assert.AreEqual(DiffType.MissingElement, diff.Type);
     Assert.AreSame(mockPath, diff.Path);
     Assert.AreEqual(DiffTargets.Both, diff.Targets);
 }
Esempio n. 3
0
        /// <summary>
        /// Adds the specified diff item to the set.
        /// </summary>
        /// <param name="item">The diff item to be added.</param>
        /// <returns>A reference to the builder itself.</returns>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="item"/> is null.</exception>
        public DiffSetBuilder Add(Diff item)
        {
            if (item == null)
                throw new ArgumentNullException("item");

            items.Add(item);
            return this;
        }
Esempio n. 4
0
 public void Constructs_ok()
 {
     var mockPath = MockRepository.GenerateStub<IXmlPathStrict>();
     var diff1 = new Diff(DiffType.MissingAttribute, mockPath, DiffTargets.Actual);
     var diff2 = new Diff(DiffType.MissingAttribute, mockPath, DiffTargets.Actual);
     var diff3 = new Diff(DiffType.MissingAttribute, mockPath, DiffTargets.Actual);
     var diffSet = new DiffSet(new[] { diff1, diff2, diff3 });
     Assert.IsFalse(diffSet.IsEmpty);
     Assert.AreElementsSame(new[] { diff1, diff2, diff3 }, diffSet);
 }