예제 #1
0
        /// <summary>
        /// Creates and returns a model from an <see cref="IPolarPlotter"/>.
        /// </summary>
        /// <param name="feedId"></param>
        /// <param name="polarPlotter"></param>
        /// <returns></returns>
        public static PolarPlotsJson ToModel(int feedId, IPolarPlotter polarPlotter)
        {
            PolarPlotsJson result = null;

            if (polarPlotter != null)
            {
                result = new PolarPlotsJson()
                {
                    FeedId = feedId,
                };
                result.Slices.AddRange(polarPlotter.TakeSnapshot().Select(r => PolarPlotsSliceJson.ToModel(r)));
            }

            return(result);
        }
예제 #2
0
 public void PolarPlotter_Constructor_Initialises_To_Known_State_And_Properties_Work()
 {
     Assert.AreEqual(0.0, _Plotter.Latitude);
     Assert.AreEqual(0.0, _Plotter.Longitude);
     Assert.AreEqual(0, _Plotter.RoundToDegrees);
     Assert.AreEqual(0, _Plotter.TakeSnapshot().Count);
 }