public void SetClientToDeviceTest()
        {
            // arrange
            const string peselNumber    = "24241241242";
            Client       expectedClient = new Client(1, "Jan", "Kowalski", "214412412421", peselNumber);

            IClient client = new ComputerService.Fakes.StubIClient()
            {
                GetClientString = (pesel) => expectedClient
            };

            const int    applicationNumber = 1;
            const string name         = "Dell Vostro";
            const string type         = "Notebook";
            DateTime     registerDate = new DateTime(2016, 3, 15);
            const bool   state        = false;

            Device device = new Device(applicationNumber, name, type, registerDate, state);

            DeviceManager deviceManager = new DeviceManager();

            // act
            deviceManager.SetClientToDevice(client, device, peselNumber);

            // assert
            Assert.AreEqual(expectedClient, device.Client);
        }
예제 #2
0
        public void ClientIdExistanceCheck()
        {
            IdChecker     idChecker  = new IdChecker();
            List <Client> allClients = new List <Client>();

            allClients.Add(new Client(1, "Jan", "Kowalski", "214412412421", "24241241242"));

            IClient client = new ComputerService.Fakes.StubIClient()
            {
                GetAllClients = () => allClients
            };

            int idToCheck = 1;

            bool result = idChecker.CheckClientIdExistance(client, idToCheck);

            Assert.IsTrue(result);
        }