public void EnsureValidKeyLength_FailureCases(int minLength, int maxLength, int increment, int testValue) { // Arrange var keyLengthsStruct = new BCRYPT_KEY_LENGTHS_STRUCT { dwMinLength = (uint)minLength, dwMaxLength = (uint)maxLength, dwIncrement = (uint)increment }; // Act & assert ExceptionAssert.ThrowsArgumentOutOfRange( () => keyLengthsStruct.EnsureValidKeyLength((uint)testValue), paramName: "keyLengthInBits", exceptionMessage: Resources.FormatBCRYPT_KEY_LENGTHS_STRUCT_InvalidKeyLength(testValue, minLength, maxLength, increment)); }
public void EnsureValidKeyLength_SuccessCases(int minLength, int maxLength, int increment, int testValue) { // Arrange var keyLengthsStruct = new BCRYPT_KEY_LENGTHS_STRUCT { dwMinLength = (uint)minLength, dwMaxLength = (uint)maxLength, dwIncrement = (uint)increment }; // Act keyLengthsStruct.EnsureValidKeyLength((uint)testValue); // Assert // Nothing to do - if we got this far without throwing, success! }