public void ValidateReportedPropertiesTest(TwinCollection twinCollection, Type expectedExceptionType)
        {
            // Arrange
            var reportedPropertiesValidator = new ReportedPropertiesValidator();

            // Act/Assert
            if (expectedExceptionType == null)
            {
                reportedPropertiesValidator.Validate(twinCollection);
            }
            else
            {
                Assert.Throws(expectedExceptionType, () => reportedPropertiesValidator.Validate(twinCollection));
            }
        }
Пример #2
0
        public void ValidateReportedPropertiesTest(TwinCollection twinCollection, Type expectedExceptionType, string expectedExceptionMessage)
        {
            // Arrange
            var reportedPropertiesValidator = new ReportedPropertiesValidator();

            // Act/Assert
            if (expectedExceptionType == null)
            {
                reportedPropertiesValidator.Validate(twinCollection);
            }
            else
            {
                Exception ex = Assert.Throws(expectedExceptionType, () => reportedPropertiesValidator.Validate(twinCollection));
                Assert.Equal(expectedExceptionMessage, ex.Message);
            }
        }