Exemple #1
0
        [TestMethod] public void GenerateDeclarationWithoutDefault()
        {
            // Arrange
            var name        = new FieldName("Status");
            var nullability = IsNullable.No;
            var enums       = new DBValue[] { DBValue.Create("Independent"), DBValue.Create("Colony") };
            var mockBuilder = new Mock <IFieldDeclBuilder>();
            var field       = new EnumField(name, nullability, Option.None <DBValue>(), enums);

            // Act
            _ = field.GenerateSqlDeclaration(mockBuilder.Object);

            // Assert
            mockBuilder.Verify(builder => builder.SetName(name));
            mockBuilder.Verify(builder => builder.SetDataType(DBType.Enumeration));
            mockBuilder.Verify(builder => builder.SetNullability(nullability));
            mockBuilder.Verify(builder => builder.SetAllowedValues(Arg.IsSameSequence <IEnumerable <DBValue> >(enums)));
            mockBuilder.Verify(builder => builder.Build());
            mockBuilder.VerifyNoOtherCalls();
        }