public void TestInit() { // Empty initializer Element e = new Element (); Assert.IsNotNull (e); // Property initializer Rating r = new ContinuousRating (89); e = null; e = new Element ("Element", "Desc", r); Assert.IsNotNull (e); Assert.AreEqual (e.Name, "Element"); Assert.AreEqual (e.Description, "Desc"); Assert.IsTrue (e.Rating.Equals (r)); }
public void Setup() { var r = DiscreteRatingFactory.CreateDiscreteIntRating (DiscreteRatingType.ZeroToFive, 4); el = new Element ("Element", "Description", r); }
/// <summary> /// Creates a new Survey from an existing Element /// </summary> /// <returns>A new survey.</returns> /// <param name="original">Original element.</param> /// <remarks> /// Used to convert elements to surveys and allow for the addition of children to them. /// </remarks> public static Survey FromElement(Element original) { return new Survey (original.Name, original.Description, original.Rating); }