コード例 #1
0
        public void SetData_TestData_NullData()
        {
            // Arrange
            var service    = new MetricDataService(metricRepository.Object, metricDataRepository.Object, hourRepository.Object, serverRepository.Object);
            var metricData = new MetricData();

            // Act
            service.SetData(metricData, (object)null);

            // Assert
            Assert.That(metricData.Data, Is.Null);
        }
コード例 #2
0
        public void SetData_TestData_Success()
        {
            // Arrange
            var service = new MetricDataService(metricRepository.Object, metricDataRepository.Object, hourRepository.Object, serverRepository.Object);
            var data    = new TestData
            {
                Id   = 3,
                Name = "Tom",
                Time = DateTime.MinValue
            };
            var metricData = new MetricData();

            // Act
            service.SetData(metricData, data);

            // Assert
            Assert.That(metricData.Data, Is.Not.Null);
            Assert.That(metricData.Data, Is.Not.Empty);
        }