public void PerformValidation_GameItemNameWithInvalidCharacters_ThrowsValidationError() { // Arrange var item = new EquipmentModel { Name = "1n val!d", Description = "Valid description", }; var command = new AddGameItemCommand(item); var fakeHandler = new AddGameItemCommandHandler(); var fakeValidator = FakeServices.GetFakeValidator(command); var handler = new ValidationCommandHandlerDecorator <AddGameItemCommand>(fakeHandler, fakeValidator, new ObjectValidator()); // Act handler.Handle(command); }
public void PerformValidation_CreateItemWithoutCategory_ThrowsValidationError() { // Arrange var item = new EquipmentModel { Name = "Valid", Description = "Valid description" }; var command = new AddGameItemCommand(item); var fakeHandler = new AddGameItemCommandHandler(); var fakeValidator = FakeServices.GetFakeValidator(command); var handler = new ValidationCommandHandlerDecorator <AddGameItemCommand>(fakeHandler, fakeValidator, new ObjectValidator()); // Act handler.Handle(command); }