コード例 #1
0
        public void ExportDiagnosisKeys_HaveNoKey_ShouldThrowException()
        {
            DatabaseKeysToBinaryStreamMapperService toBinaryStreamMapperService = new DatabaseKeysToBinaryStreamMapperService(_mapper, _appSettingsConfig);
            var data      = new List <TemporaryExposureKey> {
            };
            var exception = Assert.Throws <InvalidOperationException>(() => toBinaryStreamMapperService.ExportDiagnosisKeys(data));

            Assert.AreEqual(exception.Message, "Sequence contains no elements");
        }
コード例 #2
0
        public void ExportDiagnosisKeys_HaveKeys_ShouldReturnStream()
        {
            DatabaseKeysToBinaryStreamMapperService toBinaryStreamMapperService = new DatabaseKeysToBinaryStreamMapperService(_mapper, _appSettingsConfig);
            var expectDate   = DateTime.UtcNow;
            var data         = CreateMockedListExposureKeys(expectDate);
            var streamResult = toBinaryStreamMapperService.ExportDiagnosisKeys(data);

            Assert.AreNotEqual(0, streamResult.Length);
        }