Beispiel #1
0
        public async System.Threading.Tasks.Task PutBadProblemId()
        {
            using (var stream = new MemoryStream())
            {
                using (var streamBets = new MemoryStream())
                {
                    // Arrange
                    this._problemServices   = new ProjectSpeedy.Tests.ServicesTests.ProblemDataNotFound();
                    this._betCommentService = new ProjectSpeedy.Tests.ServicesTests.BetCommentData();
                    this._controller        = new ProjectSpeedy.Controllers.BetCommentController(this._logger.Object, this._problemServices, this._betCommentService);

                    // Act
                    var test = await this._controller.PutAsync("ProjectId", "ProblemId", "BetId", new ProjectSpeedy.Models.BetComment.BetCommentNewUpdate());

                    // Assert
                    var result = test as NotFoundResult;
                    Assert.AreEqual(404, result.StatusCode);
                }
            }
        }
Beispiel #2
0
 /// <summary>
 /// All bet comment related actions.
 /// </summary>
 /// <param name="logger">Used to log any errors which occur in this controller.</param>
 /// <param name="problemServices">Allows us to interact with problems.</param>
 /// <param name="betCommentService">Allows us to interact with bet comments.</param>
 public BetCommentController(ILogger <BetCommentController> logger, ProjectSpeedy.Services.IProblem problemServices, ProjectSpeedy.Services.IBetComment betCommentService)
 {
     this._logger            = logger;
     this._problemServices   = problemServices;
     this._betCommentService = betCommentService;
 }