using edu.jhu.Cas.Users;
using edu.jhu.Cas.Jobs;
using edu.jhu.Cas.Util;
using edu.jhu.Cas.Servers;
using NUnit.Framework;
using NUnit.Core;
using System;
using System.Threading;
using System.Configuration;

namespace edu.jhu.Cas.Test
{
	[TestFixture]	
	public class ServerTests
	{
	
		public const string DEF_TARG = "DR1";
		private long wsid = 193424723;
		private string target = "DR1";

		[Test]
			/**
			 * List servers - check rank
			 */
		public void TestRank()
		{
			int rank=Int32.MaxValue;
			Server[] targets = (new CasServers()).FindTargets(edu.jhu.Cas.Util.ID.SERVICE_ID,wsid);
			foreach(Server s in targets) 
			{
				Console.Out.WriteLine(s.Target+" "+s.Rank);
				Assert.IsTrue (s.Rank <= rank,"The Rank ordering is incorrect ");
				rank = s.Rank;

			}
		}
	}
}