Exemple #1
0
 public void setup()
 {
     _fakeTransponderReceiver = Substitute.For <ITransponderReceiver>();
     air   = new Stubspace(0);
     print = new MockPrint();
     calc  = new MockCalculator();
     sep   = new MockSeperation();
     uut   = new Decoder(_fakeTransponderReceiver, calc, print, air, sep);
 }
        public void TestCalucalteSpeedCalled(string tag, int x, int y, int altitude, string timestamp, int numtrue, int expected)
        {
            string   format = "yyyyMMddHHmmssfff";
            DateTime time   = DateTime.ParseExact(timestamp, format, CultureInfo.InvariantCulture);

            var airplane = new Airplane(tag, x, y, altitude, time);

            Print print = new Print();

            Stubspace stubspace = new Stubspace(numtrue);

            MockCalculator mockCalculator = new MockCalculator();

            //Unit under test/uut
            print.PrintAirplaneWithSpeedAndDirection(airplane, mockCalculator, stubspace);

            var actual = mockCalculator.calcspdCalls;

            Assert.AreEqual(actual, expected);
        }