示例#1
0
        public void GetData_RealName_RerurnsLocalServer()
        {
            string     expected   = "LocalServer";
            IDbInfo    dbInfo     = new FakeDbInfo(expected);
            ServerInfo serverInfo = new ServerInfo(expected);
            DataTable  dataTable  = serverInfo.GetaData(dbInfo.GetDbData());
            string     servername = dataTable.Rows[0]["ServerName"].ToString();

            Assert.AreEqual(expected, servername);
        }
示例#2
0
        public void GetData_GoodDbName_ReturnsDb()
        {
            string     serverName = "LocalServer";
            string     expected   = "db";
            IDbInfo    dbInfo     = new FakeDbInfo(serverName);
            ServerInfo serverInfo = new ServerInfo(serverName);
            DataTable  dataTable  = serverInfo.GetaData(dbInfo.GetDbData());
            string     dbName     = dataTable.Rows[1]["DbName"].ToString();

            Assert.AreEqual(expected, dbName);
        }
示例#3
0
        public void GetServeInfo_RealSize_Returns()
        {
            string     expected   = "11,9876";
            string     serverNAme = "Server2";
            double     memory     = 12.0;
            IDbInfo    dbInfo     = new FakeDbInfo(serverNAme);
            ServerInfo serverInfo = new ServerInfo(serverNAme);
            DataTable  dataTable  = serverInfo.GetaData(dbInfo.GetDbData());

            dataTable = serverInfo.GetServerInfo(dataTable, memory);
            string freespase = dataTable.Rows[dataTable.Rows.Count - 2]["DbSize"].ToString();

            Assert.AreEqual(expected, freespase);
        }