コード例 #1
0
 /// <summary>
 /// Configuration of app
 /// </summary>
 public void Configuration(IAppBuilder app)
 {
     JoinController.Configure(app);
     MasterController.Configure(app);
     VotingController.Configure(app);
     PlayController.Configure(app);
 }
コード例 #2
0
        public void HelloTest()
        {
            string testName = "Алена";

            string res = VotingController.Hello(testName);

            Assert.AreEqual("Привет, Алена!", res);
        }
コード例 #3
0
        public async Task Given_NotStartedVoting_When_Start_Then_SameState()
        {
            // Arrange and Act
            var voting     = new Voting();
            var controller = new VotingController(voting, null);


            var result = await controller.Start(new string[] { "C#", "F#" });

            // Assert
            Assert.Equal(
                JsonConvert.SerializeObject(voting.GetState()),
                JsonConvert.SerializeObject(result));
        }
コード例 #4
0
        public async Task Given_StartedVoting_When_Vote_Then_SameState()
        {
            // Arrange
            var votingService = new InMemoryVotingService();
            var voting        = await votingService.Get();

            var controller = new VotingController(votingService, null, null);

            await controller.Start(new string[] { "C#", "F#" });

            // Act
            var result = await controller.Vote("C#");

            // Assert
            Assert.Equal(
                JsonConvert.SerializeObject(voting.GetState()),
                JsonConvert.SerializeObject(result));
        }