/// <summary> /// A test for Exists /// </summary> public void ExistsTest() { // Get first surface curve PSSurfaceCurve surfaceCurve = _surfaceCurves[0]; // Check that correct value is returned Assert.IsTrue(surfaceCurve.Exists, "Incorrectly stated that entity did not exist"); // Delete entity and check again surfaceCurve.Delete(); Assert.IsFalse(surfaceCurve.Exists, "Incorrectly stated that entity existed"); }
public void DeleteTest() { // Get second surface curve and its guid PSSurfaceCurve surfaceCurve = _surfaceCurves[1]; Guid surfaceCurveGuid = InternalIdAccessor(surfaceCurve); // Delete surface curve surfaceCurve.Delete(); // Check that the surface curve is no longer in the collection foreach (T collectionSurfaceCurve in _surfaceCurves) { Assert.IsFalse(InternalIdAccessor(collectionSurfaceCurve) == surfaceCurveGuid, "Lateral still exists"); } // Check that the id of higher laterals has been decreased Assert.AreEqual("2", _surfaceCurves[1].Id, "Other IDs not changed correctly"); // Check that the name of higher laterals has been decreased Assert.AreEqual("2", _surfaceCurves[1].Name, "Other names not changed correctly"); }