Ejemplo n.º 1
0
        public void Item_NullName_DifferentElements()
        {
            var manager = new TestCaseCollectionManager();
            var tc1     = manager.Item(null);

            Assert.That(tc1, Is.Not.Null);
        }
Ejemplo n.º 2
0
        public void Item_GetTwice_SameElement()
        {
            var manager = new TestCaseCollectionManager();
            var tc1     = manager.Item("alpha");
            var tc2     = manager.Item("alpha");

            Assert.That(tc1, Is.EqualTo(tc2));
        }
Ejemplo n.º 3
0
        public void Item_GetTwoDistinct_DifferentElements()
        {
            var manager = new TestCaseCollectionManager();
            var tc1     = manager.Item("alpha");
            var tc2     = manager.Item("beta");

            Assert.That(tc1, Is.Not.EqualTo(tc2));
        }
Ejemplo n.º 4
0
        public void Item_EmptyCollection_ElementCreated()
        {
            var manager = new TestCaseCollectionManager();
            var tc      = manager.Item("alpha");

            Assert.That(tc, Is.Not.Null);
            Assert.That(tc, Is.TypeOf <CaseSet>());
        }
Ejemplo n.º 5
0
        public void Item_EmptyCollectionWithNoName_ElementCreated()
        {
            var manager = new TestCaseCollectionManager();
            var tc      = manager.Item(string.Empty);

            Assert.That(tc, Is.Not.Null);
            Assert.That(tc, Is.TypeOf <CaseSet>());
        }
Ejemplo n.º 6
0
 public GenerationState()
 {
     TestCaseCollection = new TestCaseCollectionManager();
     Template           = new TemplateManager();
     Settings           = new SettingsManager();
     List  = new TestListManager();
     Suite = new TestSuiteManager();
 }
Ejemplo n.º 7
0
        public void Focus_TwoElementsCreatedSetFocusNeverCalled_FirstElement()
        {
            var manager = new TestCaseCollectionManager();
            var tc1     = manager.Item("alpha");
            var tc2     = manager.Item("beta");

            var focus = manager.Scope;

            Assert.That(focus, Is.EqualTo(tc1));
        }
Ejemplo n.º 8
0
 public GenerationState()
 {
     TestCaseCollection = new TestCaseCollectionManager();
     Templates          = new List <string>();
     Settings           = new SettingsManager();
     List        = new TestListManager();
     Suite       = new TestSuiteManager();
     Consumables = new Dictionary <string, object>();
     (new AutoConsumableAction(true)).Execute(this);
     Variables = new Dictionary <string, GlobalVariableXml>();
 }
Ejemplo n.º 9
0
        public void Focus_TwoElementsCreatedSetFocusCalledForSecond_SecondElement()
        {
            var manager = new TestCaseCollectionManager();
            var tc1     = manager.Item("alpha");
            var tc2     = manager.Item("beta");

            manager.SetFocus("beta");
            var focus = manager.Scope;

            Assert.That(focus, Is.EqualTo(tc2));
        }
Ejemplo n.º 10
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"); });
        }
Ejemplo n.º 11
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));
        }
Ejemplo n.º 12
0
        public void Cross_ThreeTimesTwoOnItself_SixRowsFiveColumns()
        {
            var manager = new TestCaseCollectionManager();
            var tc1     = manager.Item("alpha");

            Load(tc1.Content, new string[] { "a11,a12", "a21,a22", "a31,a32" }, "alpha1,alpha2");
            var tc2 = manager.Item("beta");

            Load(tc2.Content, new string[] { "b11,b12,b13", "b21,b22,b23" }, "beta1,beta2,beta3");

            manager.Cross("alpha", "beta");
            //The focus hasn't moved ... so still on tc1
            Assert.That(tc1.Content.Rows, Has.Count.EqualTo(6));
            Assert.That(tc1.Content.Columns, Has.Count.EqualTo(5));
        }
Ejemplo n.º 13
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));
        }
Ejemplo n.º 14
0
        public void Cross_ThreeTimesTwoOnMatchingColumnWithoutPrimaryKey_FiveRowsFourColumns()
        {
            var manager = new TestCaseCollectionManager();
            var tc1     = manager.Item("alpha");

            Load(tc1.Content, new string[] { "a11,a12", "a11,a22", "a21,a32" }, "alpha1,alpha2");
            var tc2 = manager.Item("beta");

            Load(tc2.Content, new string[] { "a11,b12,b13", "a21,b22,b23", "a21,b32,b33", "a21,b42,b43", "a41,b52,b53" }, "alpha1,beta2,beta3");

            manager.SetFocus("gamma");
            manager.Cross("alpha", "beta", "alpha1");

            var focus = manager.Scope;

            Assert.That(focus.Content.Rows, Has.Count.EqualTo(5));
            Assert.That(focus.Content.Columns, Has.Count.EqualTo(4));
        }
Ejemplo n.º 15
0
        public void Cross_ThreeTimesTwoWithOneCommonColumnName_SixRowsFourColumns()
        {
            var manager = new TestCaseCollectionManager();
            var tc1     = manager.Item("alpha");

            Load(tc1.Content, new string[] { "a11,a12", "a21,a22", "a31,a32" }, "alpha1,alpha2");
            var tc2 = manager.Item("beta");

            Load(tc2.Content, new string[] { "b11,b12,b13", "b21,b22,b23" }, "alpha1,beta2,beta3");

            manager.SetFocus("gamma");
            manager.Cross("alpha", "beta");

            var focus = manager.Scope;

            Assert.That(focus.Content.Rows, Has.Count.EqualTo(6));
            Assert.That(focus.Content.Columns, Has.Count.EqualTo(4));
        }
Ejemplo n.º 16
0
        public TestCasesPresenter(RenameVariableWindow renameVariablewindow, FilterWindow filterWindow, ConnectionStringWindow connectionStringWindow, TestCaseCollectionManager testCaseCollectionManager, DataTable testCases, BindingList <string> variables, BindingList <string> connectionStringNames)
        {
            this.OpenTestCasesCommand          = new OpenTestCasesCommand(this);
            this.OpenTestCasesQueryCommand     = new OpenTestCasesQueryCommand(this);
            this.RenameVariableCommand         = new RenameVariableCommand(this, renameVariablewindow);
            this.RemoveVariableCommand         = new RemoveVariableCommand(this);
            this.MoveLeftVariableCommand       = new MoveLeftVariableCommand(this);
            this.MoveRightVariableCommand      = new MoveRightVariableCommand(this);
            this.FilterCommand                 = new FilterCommand(this, filterWindow);
            this.FilterDistinctCommand         = new FilterDistinctCommand(this);
            this.AddConnectionStringCommand    = new AddConnectionStringCommand(this, connectionStringWindow);
            this.RemoveConnectionStringCommand = new RemoveConnectionStringCommand(this);
            this.EditConnectionStringCommand   = new EditConnectionStringCommand(this, connectionStringWindow);
            this.RunQueryCommand               = new RunQueryCommand(this);

            this.testCaseCollectionManager = testCaseCollectionManager;
            TestCases                     = testCases;
            Variables                     = variables;
            ConnectionStringNames         = connectionStringNames;
            ConnectionStringSelectedIndex = -1;
            VariableSelectedIndex         = -1;
        }