Skip to content
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

Assignment 4 #80

Closed
Closed

Conversation

@pnotequalnp
Copy link

pnotequalnp commented Feb 4, 2020

No description provided.

@pnotequalnp pnotequalnp force-pushed the pnotequalnp:Assignment4 branch from b091b57 to 951fe55 Feb 4, 2020
@dsergio

This comment has been minimized.

Copy link

dsergio commented Feb 6, 2020

I will review this.

Copy link

dsergio left a comment

good work

Assignment 4

  • WebAPI Analyzers enabled ✔
  • DI properly configured
    • Services properly registered with correct scopes ✔
    • DB context properly registered ✔
    • AutoMapper properly registered ✔
  • NSwag properly setup ✔
  • API controllers properly expose CRUD operations ✔
  • Controllers are all unit tested ✔

Extra Credit

  • Unit tests in EntityServiceTests fixed approprietly
  • Mocking framework used to create the test doubles
app.UseSwaggerUi3();

app.UseMvc();

app.UseEndpoints(endpoints =>
{
_ = endpoints.MapGet("/", async context =>

This comment has been minimized.

Copy link
@dsergio

dsergio Feb 6, 2020

I think you can remove this

namespace SecretSanta.Api.Tests.Controllers
{
[TestClass]
public class GiftControllerTests : EntityControllerTests<Gift>

This comment has been minimized.

Copy link
@dsergio
@dsergio

This comment has been minimized.

Copy link

dsergio commented Feb 6, 2020

you don't have the azure pipelines badge in the README

Copy link
Collaborator

Keboo left a comment

(pnotequalnp)

Assignment4

Project Analysis Summary
Nullable Enabled:
Unexpected Disabled Warnings:
Appropriately handle all warnings:
ProjectName Nullable Solutions Analyzers Unexpected Disabled Warnings Waning Level
SecretSanta.Api Enable SecretSanta.sln IntelliTect Analyzers, Microsoft CodeQuality Analyzers, Microsoft .NET Core Analyzers, Microsoft .NET Framework Analyzers, Microsoft.CodeAnalysis.Analyzers, Microsoft.CodeAnalysis.CSharp.Analyzers, Microsoft.CodeAnalysis.VersionCheckAnalyzer, Microsoft.EntityFrameworkCore.Analyzers 4
SecretSanta.Business Enable SecretSanta.sln IntelliTect Analyzers, Microsoft CodeQuality Analyzers, Microsoft .NET Core Analyzers, Microsoft .NET Framework Analyzers, Microsoft.CodeAnalysis.VersionCheckAnalyzer, Microsoft.EntityFrameworkCore.Analyzers 4
SecretSanta.Data Enable SecretSanta.sln IntelliTect Analyzers, Microsoft CodeQuality Analyzers, Microsoft .NET Core Analyzers, Microsoft .NET Framework Analyzers, Microsoft.CodeAnalysis.VersionCheckAnalyzer, Microsoft.EntityFrameworkCore.Analyzers 4
SecretSanta.Web Enable SecretSanta.sln IntelliTect Analyzers, Microsoft CodeQuality Analyzers, Microsoft .NET Core Analyzers, Microsoft .NET Framework Analyzers, Microsoft.CodeAnalysis.VersionCheckAnalyzer 4
SecretSanta.Api.Tests Enable SecretSanta.sln IntelliTect Analyzers, Microsoft CodeQuality Analyzers, Microsoft .NET Core Analyzers, Microsoft .NET Framework Analyzers, Microsoft.CodeAnalysis.Analyzers, Microsoft.CodeAnalysis.CSharp.Analyzers, Microsoft.CodeAnalysis.VersionCheckAnalyzer, Microsoft.EntityFrameworkCore.Analyzers 4
SecretSanta.Business.Tests Enable SecretSanta.sln IntelliTect Analyzers, Microsoft CodeQuality Analyzers, Microsoft .NET Core Analyzers, Microsoft .NET Framework Analyzers, Microsoft.CodeAnalysis.VersionCheckAnalyzer, Microsoft.EntityFrameworkCore.Analyzers 4
SecretSanta.Data.Tests Enable SecretSanta.sln IntelliTect Analyzers, Microsoft CodeQuality Analyzers, Microsoft .NET Core Analyzers, Microsoft .NET Framework Analyzers, Microsoft.CodeAnalysis.VersionCheckAnalyzer, Microsoft.EntityFrameworkCore.Analyzers 4
SecretSanta.Web.Tests Enable SecretSanta.sln IntelliTect Analyzers, Microsoft CodeQuality Analyzers, Microsoft .NET Core Analyzers, Microsoft .NET Framework Analyzers, Microsoft.CodeAnalysis.VersionCheckAnalyzer 4

Main Assignment

  • WebAPI Analyzers enabled ✔
  • DI properly configured ✔
  • Services properly registered with correct scopes ✔
  • DB context properly registered ✔
  • AutoMapper properly registered ✔
  • NSwag properly setup ✔
  • API controllers properly expose CRUD operations ✔
  • Controllers are all unit tested ✔

Extra Credit

  • Unit tests in EntityServiceTests fixed appropriately
  • Mocking framework used to create the test doubles

Peer Review

  • On time
  • Accurate
  • Appropriate comments given
//public void ConfigureServices(IServiceCollection services)
//{
//}
public void ConfigureServices(IServiceCollection services)

This comment has been minimized.

Copy link
@Keboo

Keboo Feb 10, 2020

Collaborator

Member can be made static

{
protected abstract EntityController<TEntity> CreateController { get; }

protected abstract TEntity CreateEntity { get; }

This comment has been minimized.

Copy link
@Keboo

Keboo Feb 10, 2020

Collaborator

In general factory methods that always create new objects are typically done as full methods rather than properties.

var controller = CreateController;
_ = controller.Post(CreateEntity);

ActionResult<TEntity> response = await controller.Get(0);

This comment has been minimized.

Copy link
@Keboo

Keboo Feb 10, 2020

Collaborator

This works, but the fact that you can pass "0" for the id indicates that your test double does not behave like the real instance which would always fail for that id.

@Keboo Keboo closed this Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.