예제 #1
0
        public void Should_head_north_given_character_n()
        {
            const char direction = 'n';
            var        result    = Compass.Get(direction);

            Assert.AreEqual(result, Compass.north);
            Assert.AreEqual(result.left_direction, 'w');
            Assert.AreEqual(result.right_direction, 'e');
        }
예제 #2
0
        public void should_head_south_given_character_w()
        {
            const char direction = 'w';
            var        result    = Compass.Get(direction);

            Assert.AreEqual(result, Compass.west);
            Assert.AreEqual(result.left_direction, 's');
            Assert.AreEqual(result.right_direction, 'n');
        }
예제 #3
0
 /// <summary>
 /// </summary>
 /// <param name="value"></param>
 /// <returns></returns>
 public static string ShortCompass(int value)
 {
     return($"{Compass.Get(value).Symbol} ({Degrees(value)})");
 }
예제 #4
0
 /// <summary>
 /// </summary>
 /// <param name="value"></param>
 /// <returns></returns>
 public static string LongCompass(int value)
 {
     return($"{Compass.Get(value).Name} ({Degrees(value)})");
 }