Exemple #1
0
        public void CreateDeviceHistoryModelNoHistory()
        {
            var devicesGroup = new GroupModel
            {
                Id = 1,
                Description = "TestDescription",
                Devices = new List<DeviceModel>(),
                Name = "TestGroup",
            };

            devicesGroup.AuditEntity("TestUser");

            var model = new BinarySettingDeviceModel
            {
                Id = 1,
                BinarySetting = false,
                Description = "TestDescription",
                DeviceHistory = null,
                Name = "TestDevice",
                DeviceType = DeviceType.Thermometer,
                Group = devicesGroup,
                GroupId = devicesGroup.Id,
            };

            model.AuditEntity("TestUser");

            var viewModel = model.CreateDeviceViewModel();

            Assert.IsNull(viewModel.History);
        }