Exemplo n.º 1
0
        public bool TestGetCoordVars()
        {
            NcFile file = null;

            try {
                file = TestHelper.NewFile(filePath);
                NcDim dim1 = file.AddDim("time", 20);
                NcDim dim2 = file.AddDim("hdg", 20);

                NcVar var1 = file.AddVar("time", NcDouble.Instance, dim1);
                Assert.False(var1.IsNull());
                NcVar var2 = file.AddVar("hdg", NcDouble.Instance, dim2);
                Assert.False(var2.IsNull());
                NcVar var3 = file.AddVar("alt", NcDouble.Instance, new List <NcDim>()
                {
                    dim1, dim2
                });
                Assert.False(var3.IsNull());

                Dictionary <string, NcGroup> coordVars = file.GetCoordVars();
                Assert.True(coordVars.ContainsKey("time") && coordVars["time"].GetId() == file.GetId());
                Assert.True(coordVars.ContainsKey("hdg") && coordVars["hdg"].GetId() == file.GetId());
                Assert.False(coordVars.ContainsKey("alt"));
            } finally {
                file.Close();
            }
            CheckDelete(filePath);
            return(true);
        }