public void TestValidateParameterAndThrowIfIncorrect_KeySize_ShouldReturnFalse(byte[] value) { var tempKey = new TemporaryExposureKeyDto() { key = value, rollingDuration = "1.00:00:00", rollingStart = DateTime.UtcNow.Date.AddDays(-2), transmissionRiskLevel = RiskLevel.RISK_LEVEL_MEDIUM_HIGH }; parameterArgument.keys.Add(tempKey); exposureKeyValidator.ValidateParameterAndThrowIfIncorrect(parameterArgument, configurationArgument, logger.Object); Assert.IsFalse(parameterArgument.keys.Contains(tempKey)); }
public void TestValidateParameterAndThrowIfIncorrect_CorrectKey_ShouldReturnTrue() { var tempKeyWithCorrectLength = new TemporaryExposureKeyDto() { key = new byte[TemporaryExposureKeyDto.KeyLength] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, rollingDuration = "1.00:00:00", rollingStart = DateTime.UtcNow.Date.AddDays(-2), transmissionRiskLevel = RiskLevel.RISK_LEVEL_MEDIUM_HIGH }; parameterArgument.keys.Add(tempKeyWithCorrectLength); exposureKeyValidator.ValidateParameterAndThrowIfIncorrect(parameterArgument, configurationArgument, logger.Object); Assert.IsTrue(parameterArgument.keys.Contains(tempKeyWithCorrectLength)); }
public void initModel() { _dto = new TemporaryExposureKeyDto(); }