Example #1
0
        public void AddPathTest()
        {
            Path path = MockRepository.GenerateMock <Path>();

            container.AddPath(path);

            Assert.That(container.Count, Is.EqualTo(1));
            Assert.That(container.GetLastPath(), Is.EqualTo(path));
        }
Example #2
0
        public void ClearTest()
        {
            PathContainer container  = new PathContainer();
            Path          dummyPath1 = MockRepository.GenerateMock <Path>();
            Path          dummyPath2 = MockRepository.GenerateMock <Path>();

            container.AddPath(dummyPath1);
            container.AddPath(dummyPath2);

            container.Clear();

            Assert.AreEqual(0, container.Count);

            Assert.AreEqual(0, container.TotalPointCount);
        }
Example #3
0
        public void CloneTest()
        {
            IPathContainer container1 = new PathContainer();
            Path           dummyPath1 = MockRepository.GenerateMock <Path>();
            Path           dummyPath2 = MockRepository.GenerateMock <Path>();

            dummyPath1.Stub(x => x.Equals(Arg <Path> .Is.Anything)).Return(true);
            dummyPath2.Stub(x => x.Equals(Arg <Path> .Is.Anything)).Return(true);
            container1.AddPath(dummyPath1);
            container1.AddPath(dummyPath2);

            IPathContainer container2 = container1.Clone();

            Assert.True(container1.Equals(container2));
            Assert.False(container1 == container2);
        }
Example #4
0
        public void EqualsTest()
        {
            PathContainer container2 = new PathContainer();

            Assert.True(container.Equals(container));
            Assert.True(container.Equals(container2));

            Path dummyPath1 = MockRepository.GenerateMock <Path>();

            container2.AddPath(dummyPath1);

            Assert.False(container.Equals(container2));
            Assert.True(container2.Equals(container2));
        }