public async Task GetByName_WithInvalidInput_ShouldReturnInvalidResult(string name) { var dbContext = ApplicationDbContextCreatorInMemory.InitializeContext(); await this.SeedData(dbContext); var actorsRepository = new EfDeletableEntityRepository <Actor>(dbContext); var service = new ActorsService(actorsRepository); var result = service.GetByTitle <ActorViewModel>(name); Assert.Null(service.GetByTitle <ActorViewModel>(name)); }
public async Task Create_WithValidInput_ShouldReturnValidResult() { var dbContext = ApplicationDbContextCreatorInMemory.InitializeContext(); var actorsRepository = new EfDeletableEntityRepository <Actor>(dbContext); var service = new ActorsService(actorsRepository); var input = new ActorCreateModel() { FirstName = "Bob", LastName = "Ross", Gender = "Male", }; var actor = service.Create(input); var result = service.GetByTitle <ActorViewModel>("Bob"); Assert.Equal("Ross", result.LastName); Assert.Equal("Male", result.Gender); }