private static string GetOption(SelectSources optionSource, SelectSources source) { return $"<option{ GetSelected(optionSource, source) }>HtmlEncode[[{ optionSource.ToString() }]]</option>"; }
private static string GetSelected(SelectSources optionSource, SelectSources source) { return optionSource == source ? " selected=\"HtmlEncode[[selected]]\"" : string.Empty; }
private static string GetExpectedSelectElementWithPrefix(SelectSources source, bool allowMultiple) { return $"<select id=\"HtmlEncode[[Prefix_Property1]]\"{ GetMultiple(allowMultiple) } " + "name=\"HtmlEncode[[Prefix.Property1]]\">" + $"{ GetOption(SelectSources.ModelStateEntry, source) }{ Environment.NewLine }" + $"{ GetOption(SelectSources.ModelStateEntryWithPrefix, source) }{ Environment.NewLine }" + $"{ GetOption(SelectSources.ViewDataEntry, source) }{ Environment.NewLine }" + $"{ GetOption(SelectSources.PropertyOfViewDataEntry, source) }{ Environment.NewLine }" + $"{ GetOption(SelectSources.ViewDataEntryWithPrefix, source) }{ Environment.NewLine }" + $"{ GetOption(SelectSources.PropertyOfViewDataEntryWithPrefix, source) }{ Environment.NewLine }" + $"{ GetOption(SelectSources.ModelValue, source) }{ Environment.NewLine }" + $"{ GetOption(SelectSources.PropertyOfModel, source) }{ Environment.NewLine }" + "</select>"; }