Open
Conversation
balcanusebi
reviewed
Jul 20, 2020
CoffeeMachineSimulator/CoffeeMachineSimulator.Services/Services/CoffeeService.cs
Outdated
Show resolved
Hide resolved
balcanusebi
reviewed
Jul 20, 2020
CoffeeMachineSimulator/CoffeeMachineSimulator.Services/Services/CoffeeService.cs
Show resolved
Hide resolved
balcanusebi
reviewed
Jul 20, 2020
CoffeeMachineSimulator/CoffeeMachineSimulator.Services/Services/CoffeeService.cs
Outdated
Show resolved
Hide resolved
balcanusebi
reviewed
Jul 20, 2020
CoffeeMachineSimulator/CoffeeMachineSimulator.Services/Services/CoffeeService.cs
Show resolved
Hide resolved
balcanusebi
reviewed
Jul 20, 2020
CoffeeMachineSimulator/CoffeeMachineSimulator.Tests/Services/CoffeeServiceTests.cs
Outdated
Show resolved
Hide resolved
balcanusebi
reviewed
Jul 20, 2020
CoffeeMachineSimulator/CoffeeMachineSimulator.Tests/Services/CoffeeServiceTests.cs
Outdated
Show resolved
Hide resolved
balcanusebi
reviewed
Jul 20, 2020
CoffeeMachineSimulator/CoffeeMachineSimulator.Tests/Services/CoffeeServiceTests.cs
Outdated
Show resolved
Hide resolved
balcanusebi
reviewed
Jul 20, 2020
CoffeeMachineSimulator/CoffeeMachineSimulator.Tests/Services/CoffeeServiceTests.cs
Outdated
Show resolved
Hide resolved
balcanusebi
reviewed
Jul 20, 2020
CoffeeMachineSimulator/CoffeeMachineSimulator.Tests/Services/CoffeeServiceTests.cs
Show resolved
Hide resolved
balcanusebi
requested changes
Jul 20, 2020
Owner
balcanusebi
left a comment
There was a problem hiding this comment.
please do the required changes and push again
balcanusebi
reviewed
Jul 20, 2020
| [Test] | ||
| public void AddCoffeWithoutPrice_DoesNotAddCoffee() | ||
| { | ||
| var CoffeeLenghtList = coffeeService.GetCoffees().Count; |
Owner
There was a problem hiding this comment.
naming, please use camelCase, not PascalCase
balcanusebi
reviewed
Jul 20, 2020
|
|
||
| var ex = Assert.Throws<Exception>(() => coffeeService.AddCoffee(AddCoffeeDetails)); | ||
| Assert.AreEqual(ex.Message, "Already exists an entry with the same Id"); | ||
|
|
balcanusebi
reviewed
Jul 20, 2020
| var AddCoffeeDetails = coffeeService.GetCoffees()[0]; | ||
|
|
||
| var ex = Assert.Throws<Exception>(() => coffeeService.AddCoffee(AddCoffeeDetails)); | ||
| Assert.AreEqual(ex.Message, "Already exists an entry with the same Id"); |
Owner
There was a problem hiding this comment.
add a space between action and assertion
balcanusebi
reviewed
Jul 20, 2020
|
|
||
| if(coffeeId == Guid.Empty) throw new Exception("The Id given is empty"); | ||
| if (coffeeModels.Any(j => j.Id == coffeeId)) | ||
| coffeeModels.Remove(coffeeModels.First(i => i.Id == coffeeId)); |
Owner
There was a problem hiding this comment.
please add indentation for the success if branch, it's confusing to have them one right after another
balcanusebi
reviewed
Jul 20, 2020
| coffeeModels.Add(coffeeToAdd); | ||
|
|
||
| if (coffeeModels.Any(i => i == coffeeToAdd)) throw new Exception("Already exists an entry with the same Id"); | ||
| if (!(coffeeToAdd.Id == Guid.Empty || coffeeToAdd.Name == null || coffeeToAdd.Price <= 0.0f || coffeeModels.Any(j => j.Name == coffeeToAdd.Name) || coffeeModels.Any(j => j.Id == coffeeToAdd.Id) || coffeeModels.Any(j => j.Price == coffeeToAdd.Price))) |
Owner
There was a problem hiding this comment.
please make a method that does all of these checks. No line of code should be that big in order to scroll to see.
balcanusebi
requested changes
Jul 20, 2020
Owner
balcanusebi
left a comment
There was a problem hiding this comment.
please do the changes and push them again
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add test
Delete test