Exemplo n.º 1
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
        private static (TestableVoteCommand, CommandReceivedEventArgs, VotingSystem, FakeActionSystem) GetTestOperation(ChatUser chatUser = null)
        {
            var mock         = new Mock <IVotingDisplayNotification>();
            var votingSystem = new VotingSystem(mock.Object);

            votingSystem.StartVote(new List <string> {
                "A", "B", "C"
            });
            var automationSystem = new FakeActionSystem();
            var endVoteOperation = new TestableVoteCommand(new Mock <IRepository>().Object,
                                                           votingSystem, automationSystem);

            var commandReceivedEventArgs = new CommandReceivedEventArgs
            {
                Arguments = new List <string> {
                    "end"
                },
                ChatUser = chatUser ?? new ChatUser {
                    Role = UserRole.Mod
                }
            };

            return(endVoteOperation, commandReceivedEventArgs, votingSystem, automationSystem);
        }
Exemplo n.º 3
0
 public VotingSystem()
 {
     Instance = this;
     isGoing  = true;
 }
Exemplo n.º 4
0
 public TestableVoteCommand(IRepository repository, VotingSystem votingSystem, IAutomatedActionSystem automatedActionSystem) : base(repository, votingSystem, automatedActionSystem)
 {
 }