- <?xml version="1.0"?>
- <TestCases system="OnlineVoting">
- <Function name="vote">
- <TestCase id="1">
- <Input type="arg">
- <Var name="userId" value="valid"/>
- <Var name="voteChoice" value="candidateA"/>
- <Var name="voteStatus" value="notVoted"/>
- <Var name="voteTime" value="withinAllowedTime"/>
- </Input>
- <Input type="env">
- <Var name="votingPeriod" value="open"/>
- <Var name="userExists" value="yes"/>
- <Var name="userEligibility" value="eligible"/>
- <Var name="voteCount" value="valid"/>
- </Input>
- <Output>
- <Var name="voteStatus" value="cast"/>
- <Var name="voteCount" value="updated"/>
- </Output>
- </TestCase>
- <TestCase id="2">
- <Input type="arg">
- <Var name="userId" value="invalid"/>
- <Var name="voteChoice" value="candidateB"/>
- <Var name="voteStatus" value="notVoted"/>
- <Var name="voteTime" value="withinAllowedTime"/>
- </Input>
- <Input type="env">
- <Var name="votingPeriod" value="open"/>
- <Var name="userExists" value="no"/>
- <Var name="userEligibility" value="eligible"/>
- <Var name="voteCount" value="valid"/>
- </Input>
- <Output>
- <Var name="voteStatus" value="invalidUser"/>
- <Var name="voteCount" value="notUpdated"/>
- </Output>
- </TestCase>
- <TestCase id="3">
- <Input type="arg">
- <Var name="userId" value="valid"/>
- <Var name="voteChoice" value="candidateA"/>
- <Var name="voteStatus" value="alreadyVoted"/>
- <Var name="voteTime" value="withinAllowedTime"/>
- </Input>
- <Input type="env">
- <Var name="votingPeriod" value="open"/>
- <Var name="userExists" value="yes"/>
- <Var name="userEligibility" value="eligible"/>
- <Var name="voteCount" value="valid"/>
- </Input>
- <Output>
- <Var name="voteStatus" value="alreadyVoted"/>
- <Var name="voteCount" value="notUpdated"/>
- </Output>
- </TestCase>
- <TestCase id="4">
- <Input type="arg">
- <Var name="userId" value="valid"/>
- <Var name="voteChoice" value="candidateC"/>
- <Var name="voteStatus" value="notVoted"/>
- <Var name="voteTime" value="afterVotingClosed"/>
- </Input>
- <Input type="env">
- <Var name="votingPeriod" value="closed"/>
- <Var name="userExists" value="yes"/>
- <Var name="userEligibility" value="eligible"/>
- <Var name="voteCount" value="valid"/>
- </Input>
- <Output>
- <Var name="voteStatus" value="votingClosed"/>
- <Var name="voteCount" value="notUpdated"/>
- </Output>
- </TestCase>
- </Function>
- <Function name="viewResults">
- <TestCase id="5">
- <Input type="arg">
- <Var name="userId" value="valid"/>
- <Var name="accessLevel" value="admin"/>
- </Input>
- <Input type="env">
- <Var name="votingPeriod" value="closed"/>
- <Var name="voteCount" value="valid"/>
- </Input>
- <Output>
- <Var name="results" value="displayed"/>
- <Var name="winner" value="candidateA"/>
- </Output>
- </TestCase>
- </Function>
- </TestCases>
Free Packet LLC For all your hosting needs!