Exemplo n.º 1
0
        public void VerifyMatchesExpectedAtLeastVisits()
        {
            var proxy = Mock.Create <IUserService>();

            proxy.Setup(p => p.Delete("Homer"));

            var controller = new UserController(proxy);

            controller.Delete("Homer");
            controller.Delete("Homer");
            controller.Delete("Homer");

            proxy.Verify(p => p.Delete("Homer"), Occurred.AtLeast(2));
        }
Exemplo n.º 2
0
        public void VerifyMatchesExpectedAtLeastVisits()
        {
            var proxy = Mock.Create <IUserService>();

            proxy.Setup(p => p.Save("Bart")).Returns(true);

            var controller = new UserController(proxy);

            controller.Save("Bart");
            controller.Save("Bart");
            controller.Save("Bart");

            proxy.Verify(p => p.Save("Bart"), Occurred.AtLeast(2));
        }