Exemplo n.º 1
0
        public void UpdatePredictionTest()
        {
            PredictionsDatabaseRepository repository = new PredictionsDatabaseRepository();
            var result = repository.GetAllPredictions().FirstOrDefault();

            repository.UpdatePrediction(new PredictionDto {
                Id = result.Id, PredictionText = "Some new text2"
            });
        }
Exemplo n.º 2
0
        public void Test3()
        {
            IPredictionsRepository predictionsRepository = new PredictionsDatabaseRepository();
            PredictionDto          oldPred = new PredictionDto()
            {
                PredictionText = predictionsRepository.GetPredictionById(2)
            };

            predictionsRepository.UpdatePrediction(oldPred, new PredictionDto()
            {
                PredictionText = oldPred.PredictionText + "test"
            });
            Assert.Throws <Exception>((() => {
                if (predictionsRepository.GetPredictionById(2) != oldPred.PredictionText)
                {
                    throw new Exception();
                }
            }));
        }