// ---------------------------------------------------------------------------------------- /// <!-- EndemeAccess_PrependEndeme_tests --> /// <summary> /// /// </summary> private void EndemeAccess_PrependEndeme_tests() { Assert.ThingsAbout("EndemeAccess", "PrependEndeme"); // -------------------------------------------------------------------------- // Educe set // -------------------------------------------------------------------------- Guid setID = EndemeAccess.GetEndemeSetID("Animal", connection, trx); EndemeSet enSet = null; if (setID == Guid.Empty) { EndemeAccess.InsertEndemeSet(EndemeTests.WetlandAnimals, connection, trx); } else { enSet = EndemeAccess.GetEndemeSet(setID, connection, trx); } // -------------------------------------------------------------------------- // Test prepend // -------------------------------------------------------------------------- Endeme en1 = new Endeme(enSet, "ABCD"); Guid id1 = EndemeAccess.InsertEndeme(en1, connection, trx); Endeme en2 = new Endeme(enSet, "MOUSE"); Guid id2 = EndemeTableFactory_old.PrependEndeme_old(en2, id1, connection, trx); Endeme en3 = EndemeAccess.GetEndeme(id2, connection, trx); Assert.That(en3.ToString(), Is.equal_to, "MOUSEABCD"); _result += Assert.Conclusion; }
// ---------------------------------------------------------------------------------------- /// <!-- 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; }