Example #1
0
        public void Copy_SimpleMasterWithCopiedAlreadyLoaded_CopyIsNotAllowed()
        {
            var state = BuildOriginalState();

            state.CaseCollection.Add("copied", new CaseSet());

            var action = new CopyCaseAction("master", "copied");

            Assert.Throws <ArgumentException>(delegate { action.Execute(state); });
        }
Example #2
0
        public void Copy_SimpleMaster_CopyIsNotReferenceCopy()
        {
            var state  = BuildOriginalState();
            var action = new CopyCaseAction("master", "copied");

            action.Execute(state);
            var copied = state.CaseCollection["copied"];

            state.CaseCollection["master"].Content.Clear();

            Assert.That(state.CaseCollection["master"].Content.Rows, Has.Count.EqualTo(0));
            Assert.That(copied.Content.Rows, Has.Count.GreaterThan(0));
        }
Example #3
0
        public void Copy_SimpleMaster_CopyIsEffectivelyDone()
        {
            var state  = BuildOriginalState();
            var master = state.CaseCollection["master"];

            var action = new CopyCaseAction("master", "copied");

            action.Execute(state);

            Assert.That(state.CaseCollection.ContainsKey("copied"));
            var copied = state.CaseCollection["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));
        }