예제 #1
0
        public void Add_Calls_AddOrUpdateRule_From_RuleRepository()
        {
            var webAgent   = new Mock <IWebAgent>();
            var repository = new Mock <IRuleRepository>();

            var ruleController = new RuleController(repository.Object, webAgent.Object);

            var result = ruleController.Add(TestResources.Site, TestResources.Rule);

            result.Should().BeOfType <OkResult>();

            repository.Verify(mock => mock.AddOrUpdateRule(TestResources.Site, TestResources.Rule), Times.Once);
            webAgent.Verify(mock => mock.GetContent(It.IsAny <string>()), Times.Never);
        }