Ejemplo n.º 1
0
        public void FromNameGivenNameExtraLargeShouldThrow()
        {
            const string expectedName = "extra large";

            var exception = Assert.Throws <InvalidOperationException>(
                () => _ = Enumerator.FromName <SizeType>(expectedName));

            // ReSharper disable once PossibleNullReferenceException
            exception.Message.Should().Be($"'{expectedName}' is not a valid name in {typeof(SizeType)}");
        }
        public void FromNameGivenNameTestShouldThrow()
        {
            var expectedName = "Test";

            var exception = Assert.Throws <InvalidOperationException>(() =>
            {
                var actual = Enumerator.FromName <SupplierStatus>(expectedName);
            });

            exception.Message.Should().Be($"'{expectedName}' is not a valid name in {typeof(SupplierStatus)}");
        }
        public void FromNameGivenNameExtraLargeShouldThrow()
        {
            var expectedName = "extra large";

            var exception = Assert.Throws <InvalidOperationException>(() =>
            {
                _ = Enumerator.FromName <SizeType>(expectedName);
            });

            exception.Message.Should().Be($"'{expectedName}' is not a valid name in {typeof(SizeType)}");
        }
 public void FromNameGivenNameAuthorityReviewShouldBeEqual()
 {
     Enumerator.FromName <SupplierStatus>("authorityreview").Should().Be(SupplierStatus.AuthorityReview);
 }
        public void EnsureProvisioningTypeNamingMatchesOrderingApi(string name)
        {
            ProvisioningType provisioningType = Enumerator.FromName <ProvisioningType>(name);

            provisioningType.Name.Should().Be(name);
        }
Ejemplo n.º 6
0
 public void FromNameGivenNameMediumShouldBeEqual()
 {
     Enumerator.FromName <SizeType>("medium").Should().Be(SizeType.Medium);
 }