Giter Site home page Giter Site logo

votingsystem_a's Introduction

VotingSystem - Unitary Tests

The unitary tests implemented aim to test every state of the voting system : from registration, to propsal registration, voting, and finally tallying.

Registration Tests:
  ✔ should allow owner to add voters (107ms)
  ✔ should not allow non-owner to add voters (1094ms)
  ✔ should not allow owner to add the same voter twice (82ms)
  ✔ should not allow owner to add voters when registration is not open (113ms)
  ✔ should not allow owner to add empty address as voter
Proposal Tests:
  ✔ should allow voter1 to add a new proposal (183ms)
  ✔ should not add an empty proposal by voter2
  ✔ should not allow non-voters to add proposals - voter3
  ✔ should not add proposals if not in ProposalsRegistrationStarted (192ms)
Vote Tests:
  ✔ should allow voter1 to vote  (53ms)
  ✔ should not allow voter2 to vote 
  ✔ should not use invalid proposalID 
  ✔ should not vote twice  (61ms)
  ✔ should not vote if not in VotingSessionStarted (48ms)
Tally Tests:
  ✔ should allow only owner to tally 
  ✔ should not tally if not in VotingSessionEnded State (128ms)
  ✔ should tally correctly (962ms)
State Change Tests - applied to startProposalsRegistering() only, as the mecanism is exactly the same, only name state changes.
  ✔ should allow only owner to tally  (1492ms)
  ✔ should not change state if not in the right State (96ms)
  ✔ should change to next state if is in the right State + check event  (394ms)

20 passing (10s)

votingsystem_a's People

Contributors

ielboulo 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.