public void ResourceNotFoundExceptionIsThrownWhenLanguageCanNotBeFoundInDatabase() { RemoveAllTestLanguages(); var command = new GetLanguageByIdQuery(trueValidator, repo); Assert.Throws <ResourceNotFoundException>(delegate { command.Execute(request); }); }
public void LanguageIsReturnedWhenValidatorIsTrue() { var command = new GetLanguageByIdQuery(trueValidator, repo); var language = command.Execute(request); Assert.IsFalse(language == null); Assert.IsTrue(language.Name.Equals("TestName")); Assert.IsTrue(language.Description.Equals("TestDescription")); }
public LanguageController( GetLanguagesQuery getLanguagesCommand, GetLanguageByIdQuery getLanguageByIdCommand, CreateLanguageCommand createLanguageCommand, UpdateLanguageCommand updateLanguageCommand, DeleteLanguageCommand deleteLanguageCommand) { this.getLanguagesCommand = getLanguagesCommand; this.getLanguageByIdCommand = getLanguageByIdCommand; this.createLanguageCommand = createLanguageCommand; this.updateLanguageCommand = updateLanguageCommand; this.deleteLanguageCommand = deleteLanguageCommand; }
public void ArgumentExceptionIsThrownWhenValidatorIsFalse() { var command = new GetLanguageByIdQuery(falseValidator, repo); Assert.Throws <ArgumentException>(delegate { command.Execute(request); }); }