GithubHelp home page GithubHelp logo

marcel-to / applied_testmethods_s2023 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 4.87 MB

This repository contains the test exercises from the lecture "Angewandte Testverfahren" from the forth FH semester.

License: MIT License

Python 27.87% C# 72.13%

applied_testmethods_s2023's Introduction

Applied_TestMethods_S2023

This repository contains the test exercises from the lecture "Angewandte Testverfahren" from the forth FH semester.

Overview of the Examples

Who watches the watchman?

Assignment

Prepare a comprehensive test that covers the functionality of the Tour of Heroes Web Application. Evaluate the functionality of the application and implement a test using Selenium for browser automation.

The assignment will be graded based on

  • Test Coverage
  • Code Quality
  • Documentation
  • Followed Test Practices

Execution

To kill a Mockingbird

## Assignment Write and test a class library used for managing item stock and orders in a warehouse. The IWarehouse interface is defined as such:
interface IWarehouse
{
  bool HasProduct(string product);
  int CurrentStock(string product);
  void AddStock(string product, int amount);
  void TakeStock(string product, int amount);
}
  • All methods throw for invalid product names (null or empty).
  • CurrentStock throws NoSuchProductException when called with a product for which HasProduct returns false.
  • TakeStock throws NoSuchProductException when called with a product for which HasProduct returns false.
  • TakeStock throws InsufficientStockException when called with an amount that exceeds what is currently stored. The Order class is used for filling individual orders from a warehouse.

Its interface is defined as such:

class Order
{
  Order(string product, int amount);
  bool IsFilled();
  bool CanFillOrder(IWarehouse warehouse);
  void Fill(IWarehouse warehouse);
}
  • The constructor throws for invalid product names (null or empty) and amounts <1
  • IsFilled starts out with false and becomes true once Fill has been called successfully.
  • Fill rethrows any exceptions thrown by IWarehouse
  • Fill throws OrderAlreadyFilled when Fill is called for an order that has already been filled
  • CanFillOrder uses IWarehouse.HasProduct and IWarehouse.CurrentStock to check whether an order can be filled Implement and test both the Order class and an implementation of IWarehouse. When testing the Order class, use both your custom implementation of IWarehouse as well as Mock objects for testing the behaviour of Order.

Use MOQ or an equivalent Mocking library of your choice.

Execution

applied_testmethods_s2023's People

Contributors

marcel-to avatar

Watchers

 avatar

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.