public void ReturnsEnumGivenNoExplicitPriorUse()
        {
            var expected = "One";

            var result = TestEnum.FromName(expected);

            result.Name.Should().Be(expected);
        }
        public void ThrowsGivenNull()
        {
            Action action = () => TestEnum.FromName(null);

            action.Should()
            .ThrowExactly <ArgumentException>()
            .WithMessage($"Argument cannot be null or empty.{Environment.NewLine}Parameter name: name")
            .Which.ParamName.Should().Be("name");
        }
        public void ThrowsGivenNonMatchingString()
        {
            var name = "Doesn't Exist";

            Action action = () => TestEnum.FromName(name);

            action.Should()
            .ThrowExactly <SmartEnumNotFoundException>()
            .WithMessage($@"No {typeof(TestEnum).Name} with Name ""{name}"" found.");
        }
        public void ReturnsEnumGivenMatchingName()
        {
            var result = TestEnum.FromName("One");

            result.Should().BeSameAs(TestEnum.One);
        }