Ejemplo n.º 1
0
        public void GetMemoryUtilizationInPercent_SystemMemoryInformationParameterIsNull_ArgumentNullExceptionIsThrown()
        {
            // Arrange
            var memoryStatusOrchestrator = new MemoryStatusOrchestrator();

            // Act
            memoryStatusOrchestrator.GetMemoryUtilizationInPercent(null);
        }
Ejemplo n.º 2
0
        public void GetMemoryUtilizationInPercent_SystemMemoryInformationParameterIsNotInitialized_ValueIsZero()
        {
            // Arrange
            var systemMemoryInformation  = new SystemMemoryInformation();
            var memoryStatusOrchestrator = new MemoryStatusOrchestrator();

            // Act
            var result = memoryStatusOrchestrator.GetMemoryUtilizationInPercent(systemMemoryInformation);

            // Assert
            Assert.AreEqual(0d, result.Value);
        }
Ejemplo n.º 3
0
        public void GetMemoryUtilizationInPercent_SystemMemoryInformationParameterIsValid_NameParameterIsSet()
        {
            // Arrange
            var systemMemoryInformation  = new SystemMemoryInformation();
            var memoryStatusOrchestrator = new MemoryStatusOrchestrator();

            // Act
            var result = memoryStatusOrchestrator.GetMemoryUtilizationInPercent(systemMemoryInformation);

            // Assert
            Assert.IsNotNullOrEmpty(result.Name);
        }
Ejemplo n.º 4
0
        public void GetMemoryUtilizationInPercent_SystemMemoryInformationParameterValuesAreZero_ValueIsZero()
        {
            // Arrange
            var systemMemoryInformation = new SystemMemoryInformation {
                AvailableMemoryInGB = 0d, UsedMemoryInGB = 0d
            };
            var memoryStatusOrchestrator = new MemoryStatusOrchestrator();

            // Act
            var result = memoryStatusOrchestrator.GetMemoryUtilizationInPercent(systemMemoryInformation);

            // Assert
            Assert.AreEqual(0d, result.Value);
        }
Ejemplo n.º 5
0
        public void GetMemoryUtilizationInPercent_SystemMemoryInformationParameterIsValid_ValueIsCorrect()
        {
            // Arrange
            var availableMemory         = 9d;
            var usedMemory              = 1d;
            var systemMemoryInformation = new SystemMemoryInformation {
                AvailableMemoryInGB = availableMemory, UsedMemoryInGB = usedMemory
            };
            var memoryStatusOrchestrator = new MemoryStatusOrchestrator();

            // Act
            var result = memoryStatusOrchestrator.GetMemoryUtilizationInPercent(systemMemoryInformation);

            // Assert
            Assert.AreEqual(10d, result.Value);
        }