public void Test2() { IPredictionsRepository predictionsRepository = new PredictionsDatabaseRepository(); predictionsRepository.GetPredictionById(2); Assert.Throws <Exception>((() => { if (predictionsRepository.GetPredictionById(2) != "") { throw new Exception(); } })); }
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(); } })); }
public void GetPredictionByIdTest() { PredictionsDatabaseRepository repository = new PredictionsDatabaseRepository(); var result = repository.GetPredictionById(1); }