Пример #1
0
        // ----------------------------------------------------------------------------------------
        /// <!-- EndemeAccess_HappyPath_tests -->
        /// <summary>
        ///      Methods used as intended, no null, empty or border tests
        /// </summary>
        /// <remarks></remarks>
        private void EndemeAccess_HappyPath_tests()
        {
            string toEndemeTable = "Endeme";

            Assert.ThingsAbout("EndemeAccess", "HappyPath");
            InfoAspect   aspect = new InfoAspect("Test", null, "", "", "", 0);
            EndemeAccess e      = new EndemeAccess();


            EndemeSet enSet1   = EndemeTests.WetlandAnimals;
            Guid      setID1   = Guid.NewGuid();
            int       didOk1   = e.ToteEndemeSet(enSet1.WithId(setID1), connection, trx);
            Guid      setID2   = e.GetEndemeSetId(enSet1.Label, connection, trx);
            EndemeSet enSet2   = e.OnEndemeSet(setID2, connection, trx);
            Endeme    en1      = new Endeme(enSet2, "ABC", true);
            long      endemeId = e.ToEndeme(en1, toEndemeTable, connection, trx);
            Endeme    en2      = e.GetEndeme(endemeId, toEndemeTable, connection, trx);
            Endeme    en3      = en2.Copy(); en3.Add("DEF");

            int status = e.UpdateEndeme(en3, endemeId, toEndemeTable, aspect);

            Assert.That(setID2, Is.equal_to, setID1);
            Assert.That(enSet2.Count, Is.equal_to, 22);
            Assert.That(enSet2.Label, Is.equal_to, enSet1.Label);
            Assert.That(en2.ToString(), Is.equal_to, en1);
            Assert.That(en3.ToString(), Is.equal_to, "ABCDEF");
            Assert.That(enSet1.SetId, Is.not_equal_to, Guid.Empty);

            _result += Assert.Conclusion;
        }
Пример #2
0
        // ----------------------------------------------------------------------------------------
        /// <!-- EndemeAccess_HappyPath_tests -->
        /// <summary>
        ///      Methods used as intended, no null, empty or border tests
        /// </summary>
        /// <remarks></remarks>
        private void EndemeAccess_HappyPath_tests()
        {
            Assert.ThingsAbout("EndemeAccess", "HappyPath");

            EndemeSet enSet1 = EndemeTests.WetlandAnimals;
            Guid      setID1 = EndemeAccess.InsertEndemeSet(enSet1, connection, trx);
            Guid      setID2 = EndemeAccess.GetEndemeSetID(enSet1.Label, connection, trx);
            EndemeSet enSet2 = EndemeAccess.GetEndemeSet(setID2, connection, trx);
            Endeme    en1    = new Endeme(enSet2, "ABC");
            Guid      enID   = EndemeAccess.InsertEndeme(en1, connection, trx);
            Endeme    en2    = EndemeAccess.GetEndeme(enID, connection, trx);
            Endeme    en3    = en2.Copy(); en3.Add("DEF");

            int status = EndemeAccess.UpdateEndeme(en3, enID, connection, trx);

            Assert.That(setID2, Is.equal_to, setID1);
            Assert.That(enSet2.Count, Is.equal_to, 22);
            Assert.That(enSet2.Label, Is.equal_to, enSet1.Label);
            Assert.That(en2.ToString(), Is.equal_to, en1.ToString());
            Assert.That(en3.ToString(), Is.equal_to, "ABCDEF");
            Assert.That(enSet1.SetId, Is.not_equal_to, Guid.Empty);

            _result += Assert.Conclusion;
        }