Пример #1
0
        public void DoubleParameterDoWithNullActionThrows()
        {
            var builder = new DelegatingSpecimenBuilder();

            Assert.Throws <ArgumentNullException>(() =>
                                                  builder.Do <double, decimal>(null));
        }
Пример #2
0
        public void SingleParameterDoWillInvokeMethodWithCorrectParameter(
            int expected)
        {
            // Fixture setup
            var builder = new DelegatingSpecimenBuilder();

            builder.OnCreate = (r, c) => expected;

            var verified = false;
            var mock     = new CommandMock <int>();

            mock.OnCommand = x => verified = expected == x;
            // Exercise system
            builder.Do((int i) => mock.Command(i));
            // Verify outcome
            Assert.True(verified, "Mock wasn't verified.");
            // Teardown
        }