Exemplo n.º 1
0
        public void ShouldParseUsingFromValue()
        {
            FakeEnumeration temp;

            FakeEnumeration.FromValue(1).Should().Be(FakeEnumeration.One);
            FakeEnumeration.TryParse(1, out temp).Should().BeTrue();
        }
Exemplo n.º 2
0
        public void ShouldThrowArgumentExceptionWhenBadValue()
        {
            var e = Record.Exception(() => FakeEnumeration.FromValue(-1));

            e.Should().BeOfType <ArgumentException>();
            e.Message.Should().Contain((-1).ToString());
            e.Message.Should().Contain(typeof(FakeEnumeration).FullName);
            FakeEnumeration.TryParse(-1, out var temp).Should().BeFalse();
        }