public void GetContractorById()
        {
            Mock<IContractorRepository> mock = new Mock<IContractorRepository>();
            mock.Setup(a => a.Contractors).Returns(new Contractor[]
            {
                new Contractor { id = 1, name = "Firma1" },
                new Contractor { id = 2, name = "Firma2" },
                new Contractor { id = 3, name = "Firma3" },
                new Contractor { id = 4, name = "Firma4" },
                new Contractor { id = 5, name = "Firma5" },
                new Contractor { id = 6, name = "Firma6" }
            }.AsQueryable());

            ContractorController ctrl = new ContractorController(mock.Object);
            Contractor temp = ctrl.GetContractorById(4);
            Assert.IsNotNull(temp);
            Assert.AreEqual(temp.name, "Firma4");

            temp = ctrl.GetContractorById(8);
            Assert.IsNull(temp);
        }