diff options
| Commit | 89f56a7e65d69a21635787840d952b2fef2b9955 (patch) | |
|---|---|---|
| Author | 2021-04-04 14:11:08 +0300 | |
| Committer | 2021-04-04 14:11:08 +0300 | |
| Files | a572f02666310bf60b4d60f3dd36046313ba11ed /src/Service/PCC.Services/PartsService.cs | |
| pc-craft-main.tar pc-craft-main.tar.gz pc-craft-main.zip | ||
| Parent | 9f64941ab648a496fe73316c07311562625145af (diff) | |
* Added Unit Test Project for Services
* Added Unit Test file for PartService
* Added small validation functionality for CreateProcessorPart of PartService
* Added Unit Test for PartService CreateProcessorPart method
1 files changed, 7 insertions, 0 deletions
| -rw-r--r-- | src/Service/PCC.Services/PartsService.cs | 7 |
diff --git a/src/Service/PCC.Services/PartsService.cs b/src/Service/PCC.Services/PartsService.cs index 4c48ca2..c902131 100644 --- a/src/Service/PCC.Services/PartsService.cs +++ b/src/Service/PCC.Services/PartsService.cs @@ -19,6 +19,13 @@ namespace PCC.Services public async Task<bool> CreateProcessorPart(ProcessorServiceModel processorServiceModel) { + if (string.IsNullOrEmpty(processorServiceModel.Brand)) + { + // TODO: Move message to constant + // Refactor this + throw new ArgumentException("Processor Brand cannot be null or empty!"); + } + Processor processorEntity = processorServiceModel.To<Processor>(); processorEntity.Id = Guid.NewGuid().ToString(); |