Giter Club home page Giter Club logo

voting's Introduction

Tests pour le Contrat Voting.sol

En Résumé

La serie de tests a été découpé en bloc de fonctionnalités

  • Une serie de tests sur l'enregistremen des voteurs
  • Une serie de tests sur l'enregistrement des propositions
  • Une serie de tests sur la session de vote
  • Une serie de tests sur le comptage du vote et l'identification du vainqueur

Résultats

Contract deployment
  ✔ Should deploy the contract
> Tests - Registration of voters
  ✔ Should add voter (39ms)
  ✔ Should not add voter if not owner (53ms)
  ✔ Should not add a registered voter (43ms)
  ✔ Should not add proposal when session not started
  ✔ Should stop registration  of voters and start proposal registration
  ✔ Should not stop Proposal Registering
> Tests - Proposals registration
  ✔ First proposal Should be GENESIS
  ✔ Should add proposal
  ✔ Should not add proposal if Voter not registered
  ✔ Should not add empty proposal
  ✔ Should return the correct voter address
  ✔ Should not startVotingSession
> Tests - Vote session
  ✔ Should not vote if not registered
  ✔ Should not vote for not found proposal
  ✔ Should not vote more than one time (39ms)
  ✔ Should add vote and count votes (49ms)
  ✔ Should stop vote session and emit event
  ✔ Should NOnotT tallyVotes
> Tests - Tally Session
  ✔ Should the winning Id equals to 1

20 passing (4s)

Couverture

-------------|----------|----------|----------|----------|----------------|

File % Stmts % Branch % Funcs % Lines Uncovered Lines
contracts/ 100 77.08 100 100
Voting.sol 100 77.08 100 100
------------- ---------- ---------- ---------- ---------- ----------------
All files 100 77.08 100 100
------------- ---------- ---------- ---------- ---------- ----------------

voting's People

Contributors

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