Beispiel #1
0
        public void Constructor_WhenCalledWithNameAndId_SetsNameAndId(string name, ID id)
        {
            TemplateField field = new FakeTemplateField(new FakeTemplateSection(new FakeTemplate()), name, id);

            field.Name.Should().Be(name);
            field.ID.Should().Be(id);
        }
Beispiel #2
0
        public void FakeTemplateField_SetDescription()
        {
            string        fieldDescription = "test description";
            Language      language         = Language.Parse("da-DK");
            TemplateField field            = new FakeTemplateField().WithDescription(fieldDescription, language);

            field.GetDescription(language).Should().Be(fieldDescription);
            field.GetDescription(Language.Parse("en")).Should().NotBe(fieldDescription);
            field.GetDescription(Language.Parse("en")).Should().Be("");
        }
Beispiel #3
0
        public void FakeField_ShouldSubstitute_Definition1(string sectionName, string fieldName, ID sectionId, ID fieldId)
        {
            var           template      = new FakeTemplate();
            var           section       = new FakeTemplateSection(template, sectionName, sectionId);
            TemplateField templateField = new FakeTemplateField(section, fieldName, fieldId);

            Field field = new FakeField().WithDefinition(templateField);

            field.Definition.Should().Be(templateField);
        }
Beispiel #4
0
        public void Constructor_WhenCalledWithoutValues_SetsNameAndId()
        {
            var fakeField = new FakeTemplateField();

            fakeField.Builder.Should().NotBeNull();
            TemplateField field = fakeField;

            field.Should().NotBeNull();
            field.Name.Should().Be("fakeField");
            field.ID.Should().NotBeNull();
        }
Beispiel #5
0
        public void FakeTemplateField_SetValidationText()
        {
            string        text     = "test validation text";
            Language      language = Language.Parse("da-DK");
            TemplateField field    = new FakeTemplateField()
                                     .WithValidationText(text, language)
            ;

            field.GetValidationText(language).Should().Be(text);
            field.GetValidationText(Language.Parse("en")).Should().NotBe(text);
            field.GetValidationText(Language.Parse("en")).Should().Be("");
        }
Beispiel #6
0
        public void FakeTemplateField_SetTitle()
        {
            string        fieldTitle = "test title";
            Language      language   = Language.Parse("da-DK");
            TemplateField field      = new FakeTemplateField()
                                       .WithTitle(fieldTitle, language)
            ;

            field.GetTitle(language).Should().Be(fieldTitle);
            field.GetTitle(Language.Parse("en")).Should().NotBe(fieldTitle);
            field.GetTitle(Language.Parse("en")).Should().Be("");
        }
Beispiel #7
0
        public void FakeTemplateField_SetToolTip()
        {
            string        fieldToolTip = "test tooltip";
            Language      language     = Language.Parse("da-DK");
            TemplateField field        = new FakeTemplateField()
                                         .WithToolTip(fieldToolTip, language)
            ;

            field.GetToolTip(language).Should().Be(fieldToolTip);
            field.GetToolTip(Language.Parse("en")).Should().NotBe(fieldToolTip);
            field.GetToolTip(Language.Parse("en")).Should().Be("");
        }
Beispiel #8
0
        public void WithIsBlob_WhenCalled_SetIsBlob(bool isBlob)
        {
            TemplateField field = new FakeTemplateField().WithIsBlob(isBlob);

            field.IsBlob.Should().Be(isBlob);
        }
Beispiel #9
0
        public void WithStyle_WhenCalled_SetStyle(string fieldStyle)
        {
            TemplateField field = new FakeTemplateField().WithStyle(fieldStyle);

            field.Style.Should().Be(fieldStyle);
        }
Beispiel #10
0
        public void WithType_WhenCalled_SetType(string fieldType)
        {
            TemplateField field = new FakeTemplateField().WithType(fieldType);

            field.Type.Should().Be(fieldType);
        }
Beispiel #11
0
        public void WithIcon_WhenCalled_SetsIcon(string icon)
        {
            TemplateField field = new FakeTemplateField().WithIcon(icon);

            field.Icon.Should().Be(icon);
        }
Beispiel #12
0
        public void WithHelpLink_WhenCalled_SetHelpLink(string link)
        {
            TemplateField field = new FakeTemplateField().WithHelpLink(link);

            field.HelpLink.Should().Be(link);
        }
Beispiel #13
0
        public void WithSharedLanguageFallbackEnabled_WhenCalled_SetsIsSharedLanguageFallbackEnabled(bool configuredIsSharedLanguageFallbackEnabled)
        {
            TemplateField field = new FakeTemplateField().WithSharedLanguageFallbackEnabled(configuredIsSharedLanguageFallbackEnabled);

            field.IsSharedLanguageFallbackEnabled.Should().Be(configuredIsSharedLanguageFallbackEnabled);
        }
Beispiel #14
0
        public void WithIgnoreDictionaryTranslations_WhenCalled_SetsIgnoreDictionaryTranslations(bool configuredIgnoreDictionaryTranslations)
        {
            TemplateField field = new FakeTemplateField().WithIgnoreDictionaryTranslations(configuredIgnoreDictionaryTranslations);

            field.IgnoreDictionaryTranslations.Should().Be(configuredIgnoreDictionaryTranslations);
        }
Beispiel #15
0
        public void WithIsShared_WhenCalled_SetIsShared(bool isShared)
        {
            TemplateField field = new FakeTemplateField().WithIsShared(isShared);

            field.IsShared.Should().Be(isShared);
        }
Beispiel #16
0
        public void WithDefaultValue_WhenCalled_SetsDefaultValue(string defaultValue)
        {
            TemplateField field = new FakeTemplateField().WithDefaultValue(defaultValue);

            field.DefaultValue.Should().Be(defaultValue);
        }
Beispiel #17
0
        public void WithUnversioned_WhenCalled_SetUnversioned(bool unversioned)
        {
            TemplateField field = new FakeTemplateField().WithUnversioned(unversioned);

            field.IsUnversioned.Should().Be(unversioned);
        }
Beispiel #18
0
        public void FakeTemplateField_SetSortOrder(int sort)
        {
            TemplateField field = new FakeTemplateField().WithSortorder(sort);

            field.Sortorder.Should().Be(sort);
        }
Beispiel #19
0
        public void WithValidation_WhenCalled_SetValidation(string validation)
        {
            TemplateField field = new FakeTemplateField().WithValidation(validation);

            field.Validation.Should().Be(validation);
        }
Beispiel #20
0
        public void WithResetBlank_WhenCalled_SetResetBlank(bool reset)
        {
            TemplateField field = new FakeTemplateField().WithResetBlank(reset);

            field.ResetBlank.Should().Be(reset);
        }
Beispiel #21
0
        public void WithSource_WhenCalled_SetSource(string source)
        {
            TemplateField field = new FakeTemplateField().WithSource(source);

            field.Source.Should().Be(source);
        }
Beispiel #22
0
        public void WithExcludeFromTextSearch_WhenCalled_SetsExcludeFromTextSearch(bool configuredExcludeFromTextSearch)
        {
            TemplateField field = new FakeTemplateField().WithExcludeFromTextSearch(configuredExcludeFromTextSearch);

            field.ExcludeFromTextSearch.Should().Be(configuredExcludeFromTextSearch);
        }