Exemplo n.º 1
0
        public void StartingADreamStartsCalculator()
        {
            var calculator = Substitute.For <IPointsCalculator>();

            dream.Calculator = calculator;
            dream.Start();

            calculator.ReceivedWithAnyArgs().Start(3);
        }
Exemplo n.º 2
0
        public async void EndingADreamSavesItsDuration()
        {
            dream = new Dream();
            var screenReader = Substitute.For <INMZPointsScreenReader>();

            screenReader.ScreenToNMZPoints().ReturnsForAnyArgs("1048576");
            dream.NMZPointsScreenReader = screenReader;

            dream.Start();
            await Task.Delay(100);

            dream.End();

            Assert.That(Math.Abs(dream.Duration - 100) < 50, "Expected 100, was actually " + dream.Duration);
        }