public void Should_add_seo_code() { var newSeoCode = new SocioEconomicObjective { Id = int.MaxValue.ToString(), Name = "New SeoCode" }; var vm = GetProjectDetailsViewModel(); vm.SocioEconomicObjectiveCode = newSeoCode.Id; _socioEconomicObjectiveRepository.GetSocioEconomicObjective(newSeoCode.Id).Returns(newSeoCode); _controller .WithCallTo(c => c.AddSeoCode(vm)) .ShouldRenderView("Project"); Assert.That(vm.SocioEconomicObjectives.Count(o => o.Code.Id == newSeoCode.Id && o.Code.Name == newSeoCode.Name), Is.EqualTo(1), "Seo Code not added"); }
public void Should_add_seo_code_at_step2() { var newSeoCode = new SocioEconomicObjective { Id = int.MaxValue.ToString(), Name = "New SeoCode" }; var vm = GetDataCollectionViewModelStep2(); vm.SocioEconomicObjectiveCode = newSeoCode.Id; _socioEconomicObjectiveRepository.GetSocioEconomicObjective(newSeoCode.Id).Returns(newSeoCode); _controller .WithCallTo(c => c.AddSeoCode(vm)) .ShouldRenderView("DataCollectionStep2"); Assert.That(vm.SocioEconomicObjectives.Count(o => o.Code.Id == newSeoCode.Id && o.Code.Name == newSeoCode.Name), Is.EqualTo(1), "Seo Code not added"); }