Ejemplo n.º 1
0
        public void AddExtraDateFields_Let_Header_Null_When_Is_Null()
        {
            // Arrange
            this.configMock.Setup(m => m.OutExtraDateFields).Returns("label");

            GenerateFiles generateFiles = new GenerateFiles(this.config, this.spreadsheet, this.fileSystem, this.outputWriter);

            Header header = null;

            // Act
            generateFiles.AddExtraDateFields(header);

            // Assert
            header.Should().BeNull();
        }
Ejemplo n.º 2
0
        public void AddExtraDateFields_Should_Add_Label_Field_And_Length_When_It_Is_a_OutExtraDateFields()
        {
            // Arrange
            string label     = "label";
            string fieldName = $"{label}";

            this.configMock.Setup(m => m.OutExtraDateFields).Returns(fieldName);

            GenerateFiles generateFiles = new GenerateFiles(this.config, this.spreadsheet, this.fileSystem, this.outputWriter);

            Header header = new Header();

            // Act
            generateFiles.AddExtraDateFields(header);

            // Assert
            header.Fields.Find(f => f.Name == label).Length.Should().Be(20);
        }
Ejemplo n.º 3
0
        public void AddExtraDateFields_Should_Add_Label_Field_When_It_Is_a_OutExtraDateFields()
        {
            // Arrange
            string fieldName = "label";

            this.configMock.Setup(m => m.OutExtraDateFields).Returns(fieldName);

            GenerateFiles generateFiles = new GenerateFiles(this.config, this.spreadsheet, this.fileSystem, this.outputWriter);

            Header header = new Header();

            // Act
            generateFiles.AddExtraDateFields(header);

            // Assert
            header.Fields.Find(f => f.Name == fieldName).Name.Should().Be(fieldName);
            header.Fields.Find(f => f.Name == fieldName).Type.Should().Be(DatabaseEnum.TypeField.Date);
            header.Fields.Find(f => f.Name == fieldName).Extra.Should().BeTrue();
        }
Ejemplo n.º 4
0
        public void AddExtraDateFields_Should_Add_Label_And_Message_Fields_With_Lenghts_When_Where_Are_In_OutExtraDateFields()
        {
            // Arrange
            string label     = "label";
            string message   = "messageextralongbighuge";
            string fieldName = $"{label},{message}";

            this.configMock.Setup(m => m.OutExtraDateFields).Returns(fieldName);

            GenerateFiles generateFiles = new GenerateFiles(this.config, this.spreadsheet, this.fileSystem, this.outputWriter);

            Header header = new Header();

            // Act
            generateFiles.AddExtraDateFields(header);

            // Assert
            header.Fields.Find(f => f.Name == label).Length.Should().Be(20);
            header.Fields.Find(f => f.Name == message).Length.Should().Be(30);
        }