-
Notifications
You must be signed in to change notification settings - Fork 38
initial commit for commenting on code review - could not create pull … #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…request so I forked on my repo
cxprofile
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also be nice to add .editorconfig file to specify custom editor settings for coding style consistency.
Also, the file naming convention of Order.Management project can be confusing when doing this:
Order.Management.Program
As we might mistake "Management" as a file/class name
Project File Name "Order.Management" can be renamed to OrderManagement
| public Circle(int red, int blue, int yellow) | ||
| { | ||
| Name = "Circle"; | ||
| base.Price = circlePrice; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- call to "base" could be removed as this call is redundant, as constructor of derived class implicitly calls the constructor for the base class - please implement in subsequent cases.
| { | ||
| Console.WriteLine("\nYour cutting list has been generated: "); | ||
| Console.WriteLine(base.ToString()); | ||
| generateTable(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to exercise standard naming conventions using "PascalCase" for class/functions/method names and "camelCase" for instance variable, arrays, elements and parameter names. Please implement in subsequent cases
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>netcoreapp3.0</TargetFramework> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to eliminate warning from IDE using .NET version that has deprecated support, we can change to a higher supported version
Order.Management/Order.cs
Outdated
| { | ||
| return "\nName: " + CustomerName + " Address: " + Address + " Due Date: " + DueDate + " Order #: " + OrderNumber; | ||
| } | ||
| public override string ToString() => "\nName: " + CustomerName + " Address: " + Address + " Due Date: " + DueDate + " Order #: " + OrderNumber; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Using lambda expression/one-liners enhance performance and makes the code simpler - may be applied to this method because it does a simple return.
-
We can also implement additional interface class for Order to Inherit to simplify calls of report functions from the child classes CuttingListReport, InvoiceReport and PaintingReport.
Refer to attached sample implementations:
CuttingListReport.cs.txt
InvoiceReport.cs.txt
IReport.cs.txt
Order.cs.txt
PaintingReport.cs.txt
- Please also refer to additional fixes that are not included in this initial commit
( referring to above attached Order.cs.txt):
3.1 additional handling for null exception cases can be added to code
3.2 Fix on displaying OrderNumber is done - as this displays "0" when run.
3.3 applied usage of interpolated strings example:
row += $"{AlignCentre(column, width)}|";
| { | ||
| class Program | ||
| { | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for readability purposes, we can add one new line per line of code to separate function/method/instance calls or simply group logical functions.
Order.Management/Program.cs
Outdated
| { | ||
|
|
||
| // Main entry | ||
| [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "<Pending>")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just adding this part to remove warnings on IDE - to implement "0 warning"
| public static Circle OrderCirclesInput() | ||
| { | ||
| Console.Write("\nPlease input the number of Red Circle: "); | ||
| int redCircle = Convert.ToInt32(userInput()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Please apply proper naming Convention - change method name from "userInput()" to "UserInput()"
- please apply to all subsequent calls for this method
-
Exception Handling - This line would result to exception error when a character input is keyed in - would be good to add another function call that would handle the exception without using try{} catch{} because this is a simple method.
-
Attached a sample implementation of modified UserInput() for Program.cs for reference:
Program.cs.txt
| abstract class Shape | ||
| { | ||
| public string Name { get; set; } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
standard coding practice - add new line for readability of function/method/instance declarations - please apply as needed
Order.Management/Shape.cs
Outdated
|
|
||
| public int NumberOfYellowShape { get; set; } | ||
|
|
||
| public int TotalQuantityOfShape() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This method call can be converted to Property since method is simple
Kindly see attached sample implementation of Shapes.cs:
- Also, notice that we can remove unneeded "using" calls - please implement removal of unused "using" statement calls on all affected programs - these are usually greyed out by IDE.
|
|
||
| public int TotalAmountOfRedShapes() | ||
| { | ||
| return base.OrderedBlocks[0].NumberOfRedShape + base.OrderedBlocks[1].NumberOfRedShape + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as per comment regarding calls to "base"
…request so I forked on my repo