Exemplo n.º 1
0
        public void test_random_nextInteger_maxValue()
        {
            MockRandomImpl mock_random = new MockRandomImpl();

            Assert.That(mock_random.next(10), Is.EqualTo(5));
            Assert.That(mock_random.next(3), Is.EqualTo(3));
        }
Exemplo n.º 2
0
        public void test_random_nextBytes()
        {
            MockRandomImpl mock_random = new MockRandomImpl();

            byte[] bytes = new byte[10];

            mock_random.nextBytes(bytes);

            for (int i = 0; i < 10; ++i)
            {
                Assert.That(bytes[i] == (byte)i);
            }
        }
Exemplo n.º 3
0
        public void test_random_nextDouble()
        {
            MockRandomImpl mock_random = new MockRandomImpl();

            Assert.That(mock_random.nextDouble(), Is.EqualTo(5.0));
        }
Exemplo n.º 4
0
        public void test_random_ToString()
        {
            MockRandomImpl mock_random = new MockRandomImpl();

            Assert.That(mock_random.GetType().ToString(), Is.EqualTo(mock_random.ToString()));
        }
Exemplo n.º 5
0
        public void test_random_nextInteger()
        {
            MockRandomImpl mock_random = new MockRandomImpl();

            Assert.That(mock_random.next(), Is.EqualTo(5));
        }