Ejemplo n.º 1
0
 public Worker(ILogger <Worker> logger, ICommandService commandService)
 {
     _commandService    = commandService;
     _clientMachineInfo = new ClientMachineInfo();
     _logger            = logger;
     _hubConnection     = new HubConnectionBuilder()
                          .WithUrl("http://localhost:49175/commands")
                          .Build();
 }
Ejemplo n.º 2
0
        public void Client_WhenCreatingClientMustReturnMachineName()
        {
            //Arrange
            var client = new ClientMachineInfo();
            //Act
            var clientMachineName = "Localhost";
            var name = client.Name;

            //Assert
            Assert.NotEqual(name, clientMachineName);
        }
Ejemplo n.º 3
0
        public void Client_WhenCreatingClientMustReturnDotNetVersion()
        {
            //Arrange
            var client = new ClientMachineInfo();
            //Act
            var dotnetVersion       = "3.1.200";
            var clientDotnetVersion = client.DotnetVersion;

            //Assert
            Assert.NotEqual(dotnetVersion, clientDotnetVersion);
        }
Ejemplo n.º 4
0
        public void Client_WhenCreatingClientMustReturnOSVersion()
        {
            //Arrange
            var client = new ClientMachineInfo();
            //Act
            var osVersion       = "Windows 10";
            var clientOSVersion = client.OSVersion;

            //Assert
            Assert.NotEqual(osVersion, clientOSVersion);
        }
Ejemplo n.º 5
0
        public void Client_WhenCreatingClientMustReturnAntiVirusName()
        {
            //Arrange
            var client = new ClientMachineInfo();
            //Act
            var avLocal  = "Avast";
            var clientAV = client.AntiVirusName;

            //Assert
            Assert.NotEqual(avLocal, clientAV);
        }
Ejemplo n.º 6
0
        public void Client_WhenCreatingClientMustReturnIPAddress()
        {
            //Arrange
            var client = new ClientMachineInfo();
            //Act
            var ipLocal  = "192.168.88.150";
            var clientIP = client.IP;

            //Assert
            Assert.Equal(ipLocal, clientIP);
        }
Ejemplo n.º 7
0
        public void Client_WhenCreatingClientMustReturnHDInformation()
        {
            //Arrange
            var client = new ClientMachineInfo();
            //Act
            var freeSpace = client.HardDiskInfo["C-FreeSpace"];
            var totalSize = client.HardDiskInfo["C-TotalSize"];

            //Assert
            Assert.NotEqual(0, freeSpace);
            Assert.NotEqual(0, totalSize);
        }
Ejemplo n.º 8
0
 public async Task SendMachineInfo(ClientMachineInfo clientMachineInfo, string user)
     => await Clients.All.SendInfoClientMachine(clientMachineInfo, user);