예제 #1
0
 public virtual void ThrowsOnNullArgumentBackTest(ConverterTestCase convCase)
 {
     Assert.Throws <NullReferenceException>(
         code: () => convCase.Converter.ConvertBack(value: null,
                                                    targetType: convCase.BackendType,
                                                    parameter: null,
                                                    culture: CultureInfo.CurrentCulture),
         message: "Converted back null without an exception.");
 }
        public JsonDicomConverterTests(ConverterTestCase converterTestCase)
        {
            Type converterType;

            switch (converterTestCase)
            {
            case ConverterTestCase.Standard:
                converterType = typeof(JsonDicomConverter);
                break;

            case ConverterTestCase.SmiStrict:
                converterType = typeof(SmiStrictJsonDicomConverter);
                break;

            case ConverterTestCase.SmiLazy:
                converterType = typeof(SmiLazyJsonDicomConverter);
                break;

            default:
                throw new Exception("No converter for test case " + converterTestCase);
            }

            _jsonDicomConverter = TranslationTestHelpers.GetConverter(converterType);
        }