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); }
public VotingSystem() { Instance = this; isGoing = true; }
public TestableVoteCommand(IRepository repository, VotingSystem votingSystem, IAutomatedActionSystem automatedActionSystem) : base(repository, votingSystem, automatedActionSystem) { }