Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Service / PCC.Services
diff options
context:
space:
mode:
Commit89f56a7e65d69a21635787840d952b2fef2b9955 (patch)
Author
 ivaylo.zhelev <ivaylo.zhelev@solarwinds.com>
2021-04-04 14:11:08 +0300
Committer
 ivaylo.zhelev <ivaylo.zhelev@solarwinds.com>
2021-04-04 14:11:08 +0300
Filesa572f02666310bf60b4d60f3dd36046313ba11ed /src/Service/PCC.Services
pc-craft-main.tar
pc-craft-main.tar.gz
pc-craft-main.zip
Parent9f64941ab648a496fe73316c07311562625145af (diff)
Unit tests added HEAD main
* 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.cs7
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();