Пример #1
0
        public void FunctionFreReturnsExpectedValue()
        {
            var sut    = new Fre();
            var result = sut.Execute(new List <Accumulator> {
                new Accumulator(3.0)
            });

            Assert.AreEqual(48000, result.ValueAsDouble());
        }
Пример #2
0
 private static void Beep(Fre freq = Fre.no, Dur dura = Dur.crom)
 {
     if (freq != Fre.no)
     {
         Console.Beep((int)freq, (int)dura);
     }
     else
     {
         Thread.Sleep((int)dura);
     }
 }
Пример #3
0
        public void FunctionFreRequiresOneParameter(int count, bool throwsException)
        {
            var sut        = new Fre();
            var parameters = new List <Accumulator> {
            };

            for (int i = 0; i < count; i++)
            {
                parameters.Add(new Accumulator(3.0));
            }

            var result = Test.Throws <SyntaxErrorException, Accumulator>(
                () => sut.Execute(parameters),
                throwsException);
        }