Beispiel #1
0
        public void Copy_SimpleMasterWithCopiedAlreadyLoaded_CopyIsNotAllowed()
        {
            var manager = new TestCaseCollectionManager();
            var master  = manager.Item("master");

            Load(master.Content, new string[] { "a11,a12", "a11,a22", "a21,a32" }, "alpha1,alpha2");

            var copied = manager.Item("copied");

            Load(copied.Content, new string[] { "b11,b12", "b11,b22" }, "beta1,beta2");

            Assert.Throws <ArgumentException>(delegate { manager.Copy("master", "copied"); });
        }
Beispiel #2
0
        public void Copy_SimpleMaster_CopyIsNotReferenceCopy()
        {
            var manager = new TestCaseCollectionManager();
            var master  = manager.Item("master");

            Load(master.Content, new string[] { "a11,a12", "a11,a22", "a21,a32" }, "alpha1,alpha2");

            manager.Copy("master", "copied");
            var copied = manager.Item("copied");

            manager.Item("master").Content.Clear();

            Assert.That(master.Content.Rows, Has.Count.EqualTo(0));
            Assert.That(copied.Content.Rows, Has.Count.GreaterThan(0));
        }
Beispiel #3
0
        public void Copy_SimpleMaster_CopyIsEffectivelyDone()
        {
            var manager = new TestCaseCollectionManager();
            var master  = manager.Item("master");

            Load(master.Content, new string[] { "a11,a12", "a11,a22", "a21,a32" }, "alpha1,alpha2");

            manager.Copy("master", "copied");
            var copied = manager.Item("copied");

            for (int i = 0; i < master.Content.Rows.Count; i++)
            {
                Assert.That(copied.Content.Rows[i].ItemArray, Is.EqualTo(master.Content.Rows[i].ItemArray));
            }

            Assert.That(copied.Content.Rows, Has.Count.EqualTo(master.Content.Rows.Count));
        }