Пример #1
0
        public void GetValue_ValueDosentMatchFormat_ThrowsFormatException()
        {
            IConverter<Guid> converter = new GuidConverter("N");

            Action action = () => converter.GetValue("00000000-0000-0000-0000-000000000000");

            Assert.Throws<FormatException>(action);
        }
Пример #2
0
        public void GetValue_NullFormat_IsValid(string value)
        {
            IConverter<Guid> converter = new GuidConverter();

            Guid result = converter.GetValue(value);

            Assert.Equal(new Guid(new byte[16]), result);
        }
Пример #3
0
        public void GetValue_FormatSpecified_IsValid()
        {
            IConverter<Guid> converter = new GuidConverter("N");

            Guid result = converter.GetValue("00000000000000000000000000000000");

            Assert.Equal(new Guid(new byte[16]), result);
        }
Пример #4
0
        public void GetValue_ValueDosentMatchFormat_ThrowsFormatException()
        {
            IConverter <Guid> converter = new GuidConverter("N");

            Action action = () => converter.GetValue("00000000-0000-0000-0000-000000000000");

            Assert.Throws <FormatException>(action);
        }
Пример #5
0
        public void GetValue_FormatSpecified_IsValid()
        {
            IConverter <Guid> converter = new GuidConverter("N");

            Guid result = converter.GetValue("00000000000000000000000000000000");

            Assert.Equal(new Guid(new byte[16]), result);
        }
Пример #6
0
        public void GetValue_NullFormat_IsValid(string value)
        {
            IConverter <Guid> converter = new GuidConverter();

            Guid result = converter.GetValue(value);

            Assert.Equal(new Guid(new byte[16]), result);
        }