示例#1
0
        public void UpdateMappedColumnsTestNull()
        {
            LayerMap selectedLayerMap = new LayerMap(new Layer());

            // Check what happens if we send null.
            LayerMapExtensions.UpdateMappedColumns(null);

            // Check what happens if we send null group.
            LayerMapExtensions.UpdateMappedColumns(selectedLayerMap);

            Assert.IsNull(selectedLayerMap.LayerDetails.Group);
        }
示例#2
0
        public void UpdateMappedColumnsSkyTest()
        {
            Group skyGroup = new Group("Sky", GroupType.ReferenceFrame, null);

            LayerMap selectedLayerMap = new LayerMap(new Layer());

            selectedLayerMap.LayerDetails.Group = skyGroup;

            Collection <ColumnType> mappedColTypes = new Collection <ColumnType>();

            mappedColTypes.Add(ColumnType.RA);
            mappedColTypes.Add(ColumnType.Dec);
            mappedColTypes.Add(ColumnType.Lat);
            mappedColTypes.Add(ColumnType.Long);

            selectedLayerMap.MappedColumnType = mappedColTypes;

            LayerMapExtensions.UpdateMappedColumns(selectedLayerMap);

            Assert.AreEqual(selectedLayerMap.MappedColumnType[0], ColumnType.RA);
            Assert.AreEqual(selectedLayerMap.MappedColumnType[1], ColumnType.Dec);
            Assert.AreEqual(selectedLayerMap.MappedColumnType[2], ColumnType.None);
            Assert.AreEqual(selectedLayerMap.MappedColumnType[3], ColumnType.None);
        }