public void CheckFullStandardDetailsAreReturned()
        {
            var standard = _repository.GetStandardCollationByStandardId(_standardId1).Result;

            Assert.AreEqual(_standardId1, standard.StandardId);
            Assert.AreEqual(_title1, standard.Title);
            Assert.AreEqual(_referenceNumber1, standard.ReferenceNumber);
            Assert.AreEqual(_standardDataLevel1, standard.StandardData.Level);
        }
Beispiel #2
0
        public async Task CheckFullStandardDetailsAreReturned(int standardId)
        {
            var standardExpected = _standardCollations.Single(p => p.StandardId == standardId);
            var standardReturned = (await _repository.GetStandardCollationByStandardId(standardId));

            Assert.AreEqual(standardExpected.StandardId, standardReturned.StandardId);
            Assert.AreEqual(standardExpected.Title, standardReturned.Title);
            Assert.AreEqual(standardExpected.ReferenceNumber, standardReturned.ReferenceNumber);

            if (standardExpected.StandardData != null)
            {
                Assert.AreEqual(JsonConvert.DeserializeObject <StandardDataModel>(standardExpected.StandardData).Level, standardReturned.StandardData.Level);
            }
            else
            {
                Assert.IsNull(standardReturned.StandardData);
            }
        }
        public async Task UpdateStandardCollationToRemoveStandard(int standardId, bool isLiveBefore, bool isLiveAfter)
        {
            var _lastestStandardCollations = Clone(_existingStandardCollations);

            _lastestStandardCollations.RemoveAll(p => p.StandardId == standardId);

            var beforeStandard = await _repository.GetStandardCollationByStandardId(standardId);

            var result = await _repository.UpsertApprovedStandards(_lastestStandardCollations);

            var afterStandard = await _repository.GetStandardCollationByStandardId(standardId);

            Assert.AreEqual(isLiveBefore, beforeStandard != null);
            Assert.AreEqual(isLiveAfter, afterStandard != null);
        }