public void Allow_Modify_With_Entity_Returns(Type entityType, bool isLocalAdmin, bool isGlobalAdmin, OrganizationRole?otherRole, bool expectedResult) { //Arrange var orgId = A <int>(); _userContext.Setup(x => x.OrganizationIds).Returns(new[] { orgId }); SetupUserContext(orgId, isLocalAdmin, isGlobalAdmin, otherRole); var entity = (IEntity)MoqTools.MockedObjectFrom(entityType); //Act var allow = _sut.AllowModification(entity); //Assert Assert.Equal(expectedResult, allow); }
public void MoviesAppService_Processar_Campeonato_Campeao_VingadoresGuerraInfinita() { bool testeOk = false; //Filtros sugeridos pelo problema var filterIds = new string[] { "tt7784604", "tt3778644", "tt5463162", "tt3606756", "tt4881806", "tt5164214", "tt4154756", "tt3501632" }; IEnumerable <MoviesModel> listaFilmes = MoqTools.GerarListaMovies(); listaFilmes = listaFilmes.Where(c => filterIds.Contains(c.Id)); IEnumerable <MoviesModel> campeos = MoviesAppService.GerarCampeonato(listaFilmes); foreach (var item in campeos) { if (item.Id == "tt4154756") { testeOk = true; } } Assert.IsTrue(testeOk); }
public void MoviesAppService_Nao_Foram_Selecionados_Competidores() { IEnumerable <MoviesModel> listaFilmesVazia = MoqTools.GerarListaMoviesVazia().ToList(); Assert.IsTrue(!listaFilmesVazia.Any()); }