예제 #1
0
 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));
 }
예제 #2
0
 public void Setup()
 {
     var r = DiscreteRatingFactory.CreateDiscreteIntRating (DiscreteRatingType.ZeroToFive, 4);
     el = new Element ("Element", "Description", r);
 }
예제 #3
0
파일: Survey.cs 프로젝트: savish/rate-it
 /// <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);
 }