Beispiel #1
0
        public void EmptyConstructor_ShouldCallOtherConstructor()
        {
            //---------------Set up test pack-------------------
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var attemptsViewModel = new AttemptsViewModel();

            //---------------Test Result -----------------------
            Assert.IsNotNull(attemptsViewModel.LogRepository);
        }
Beispiel #2
0
        public void Constructor_ShouldCallGetKataAttemptLogs()
        {
            //---------------Set up test pack-------------------
            var logRepository = Substitute.For <ILogRepository>();
            var attemptLogs   = new List <IAttemptLog>();
            var task          = new Task <List <IAttemptLog> >(() => attemptLogs);

            logRepository.GetKataAttemptLogs(Arg.Any <string>(), 20).Returns(task);
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var viewModel = new AttemptsViewModel(logRepository);

            //---------------Test Result -----------------------
            logRepository.Received(1).GetKataAttemptLogs(Arg.Any <string>(), 20);
        }