GithubHelp home page GithubHelp logo

jeremiahcm / 2022-phase-1-csharp-assignment Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nzmsa/2022-phase-1-csharp-assignment

0.0 0.0 0.0 12 KB

NZMSA 2022 Phase 1 repository for completing the C# Workshop. Forked from https://github.com/NZMSA/2022-Phase-1-CSharp-Assignment

C# 100.00%

2022-phase-1-csharp-assignment's Introduction

C# Assignment

Welcome to the C# Workshop. The goal for this assignment is for you to get familar with C# concepts and have some hands on experience with C# and dotnet. You will be completing the missing code in this CLI application and fix up the code to pass the existing unit tests. If you haven't already, please complete Microsoft Learn Path before attempting this workshop.

Pre-requisites:

Assignment

You should not need to edit the following files

  • Any unit tests located in LibraryService.Tests
  • The GitHub workflows located in .github/workflows

The following is the recommended steps to take for this assignment.

Exercise 1:

Implement the missing code inside LibraryService/Book.cs

The tests in LibraryService.Tests/LibraryService_Book.cs should pass after you have implemented the missing code.

There are a total of 2 tests that fail in the LibraryService_Book.cs file.

Helpful details:

  • A book can only be borrowed to a person if the book is available.
  • A book can only be returned by the person who borrowed it.
  • A book can only be borrowed to a single person.

Exercise 2:

Implement the missing code inside LibraryService/LibraryService.cs

The 5 tests in LibraryService.Tests/LibraryService_Library.cs should pass after you have implemented the missing code.

There are a total of 8 tests that fail in the LibraryService_Book.cs file.

Helpful details:

  • All the details in Exercise 1 apply to Exercise 2.
  • Items can be added, gotten, removed using the Library (proper exception handling).
  • A person can check out a item by id if the item is available.
  • A person can return a item by id if the item is borrowed by the person.
  • The isbn is the id for a book

Exercise 3:

Implement the missing code inside LibraryService/Video.cs

The tests in LibraryService.Tests/LibraryService_Video.cs should pass after you have implemented the missing code.

There are a total of 2 tests that fail in the LibraryService_Video.cs file. There are also a total of 3 tests that fail in the LibraryService_Library.cs file.

Helpful details:

  • A video can only be borrowed to a person if the book is available.
  • A video can be borrowed a limited number of times based on copies
  • A video can only be returned by a person who has borrowed it.
  • A video can be borrowed again after someone has returned a copy.

How to run

Running using dotnet cli is the recommended way to run the application.

Run the CLI

dotnet run --project ./LibraryService

Result:

Choose an option from the following list:
        p - Person
        a - Add Book
        v - Add Video
        d - Remove Item
        b - Borrow Item
        r - Return Item
Your option?

Run the test suite

dotnet test --no-restore --verbosity normal

By default this project should have 2 passing test and 12 failing tests

Failed!  - Failed:    12, Passed:     2, Skipped:     0, Total:    14, Duration: 39 ms

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.