Beispiel #1
0
        public void RequestX_OnlyReadsFromJsonFileOnce()
        {
            //Arrange
            A.CallTo(() => _jsonFile.Read()).Returns(_model);

            //Act
            _modelJsonRepo.GetPrimaryStats();
            _modelJsonRepo.GetPrimaryStats();
            _modelJsonRepo.GetSkills();
            _modelJsonRepo.GetSkills();

            //Assert
            A.CallTo(() => _jsonFile.Read()).MustHaveHappenedOnceExactly();
        }
 private Model GetModel()
 {
     return(_model ?? (_model = _databaseFile.Read()));
 }