public void DeleteProgressWhenNoProgressIsStarted()
        {
            _contextMock = new Mock<IDbContext>();

            _participant = new Participant { Id = 1, Email = "", Scores = null, UserSetting = null, Progress = null };
            _controller = new ProgressController(_contextMock.Object, _participant);
            SetupControllerForTests(_controller);

            var request = _controller.Delete();
        }
        public void PutProgressReturnsCreatedStatusCode()
        {
            _contextMock = new Mock<IDbContext>();
            var list = CreateSampleData(3);
            _contextMock.Setup(m => m.Assignments).Returns(list);
            _contextMock.Setup(m => m.Progresses);
            _participant = new Participant { Id = 1, Email = "", Scores = null, UserSetting = null, Progress = null };
            _controller = new ProgressController(_contextMock.Object, _participant);
            SetupControllerForTests(_controller);

            Progress progress = new Progress { Assignment = list.Find(1), Id = 2, Participant = _participant, StartTime = DateTime.Now };
            var result = _controller.Put(1, progress);
            Assert.AreEqual(HttpStatusCode.InternalServerError, result.StatusCode);
        }
 public void SetUp()
 {
     _contextMock = new Mock<IDbContext>();
     _participant = new Participant { Id = 1, Email = "", Scores = null, UserSetting = null };
     Progress progress = new Progress { Assignment = new Assignment { Id = 1, MaxSolveTime = 1000 }, Id = 1, StartTime = DateTime.Now, Participant = _participant };
     _participant.Progress = progress;
     _controller = new ProgressController(_contextMock.Object, _participant);
     MapperConfig.Configure();
 }
        public void SetConstructorWithoutGivenParticipantGivesInvalidOperationFromTest()
        {
            _controller = new ProgressController(_contextMock.Object);

            Assert.IsTrue(true);
        }