Ejemplo n.º 1
0
        public void TestCR()
        {
            var testenant = new Tenant(1, "*****@*****.**");

            var testrep = testenant.CreateRepair("I got issue", "many issue");

            Assert.Equal(testrep.Tenant_ID, 1);
            Assert.Equal(testrep.Issue, "I got issue");
            Assert.Equal(testrep.IssueDetails, "many issue");

            testenant.ActiveFlag = false;

            Assert.Equal(testenant.CreateRepair("dummy", "dummy"), null);
        }
        public void TestAssign()
        {
            var adm1      = new Admin(1, "this", "guy", "*****@*****.**", 0000000, "yes", "Worker");
            var testw1    = new Worker(1, "that", "guy", "*****@*****.**", 555010101, "no", "Worker");
            var testenant = new Tenant(1, "another", "guy", "*****@*****.**", 555010101, "no", "Tenant", true);

            var testrep = testenant.CreateRepair("I got issue", "many issue");

            adm1.AssignToOther(testrep, testw1);

            Assert.Equal(testrep.Worker_ID, 1);

            Assert.Equal(testrep.Worker_ID, 2);
        }