Exemplo n.º 1
0
        public void OperatorTest()
        {
            var set = new NewVipAvtoSet();

            set.AddOperator("ivan", "ivanov", "vanya", "password", "Администратор");
            set.SetCurrentOperator("vanya");

            set.AddOperator("ivan", "ivanov", "vann", "password", "Оператор");
            set.AddOperator("ivan", "ivanov", "vffdanya", "password", "Уволен");
            set.AddOperator("ivan", "ivanov", "fdssdf", "password", "Дятел");

            Assert.AreEqual("vanya", set.Operators[0].Login);
            Assert.AreEqual("ivan", set.Operators[0].Name);
            Assert.AreEqual("ivanov", set.Operators[0].LastName);
            Assert.AreEqual(NewVipAvtoSet.GetHash("password"), set.Operators[0].Password);

            Assert.AreEqual(Rights.Administrator, set.GetOperatorRight());
            Assert.AreEqual(set.Operators[0].IdOperator, set.GetOperatorId());

            set.SetCurrentOperator(null);
        }