public void ChoiceColumn_Map_ReturnsBooleanColumnPOCO() { //given FieldChoice field = new ShimFieldChoice(); ShimField.AllInstances.FieldTypeKindGet = (a) => FieldType.Choice; setUpShimField(); //when var column = columnMappingResolver.Map(field); //then Assert.IsInstanceOfType(column, typeof(ChoiceColumnPOCO)); }
public void ChoiceColumn_Map_AppliesAllProperties() { //given FieldChoice field = new ShimFieldChoice(); ShimField.AllInstances.FieldTypeKindGet = (a) => FieldType.Choice; setUpShimField(); ShimFieldMultiChoice.AllInstances.ChoicesGet = (a) => new string[] { "choice1", "zźćó ń", "qwer" }; //when var column = columnMappingResolver.Map(field); var specificColumn = column as ChoiceColumnPOCO; //then Assert.AreEqual(field.Title, column.DisplayName); Assert.AreEqual(field.InternalName, column.InternalName); Assert.AreEqual(field.Required, column.Required); Assert.AreEqual(field.Choices[0], specificColumn.Choices[0]); Assert.AreEqual(field.Choices[1], specificColumn.Choices[1]); Assert.AreEqual(field.Choices[2], specificColumn.Choices[2]); }