Beispiel #1
0
        public void Should_give_different_appliance_instances_as_default()
        {
            var mockClock     = new Mock <ITime>();
            var appliances    = new Appliances(mockClock.Object);
            var firstDefaults = appliances.All;
            var nextDefaults  = appliances.All;

            Assert.False(nextDefaults.Any(appliance => firstDefaults.Any(first => first.Id == appliance.Id)));
        }
Beispiel #2
0
        public Household(int communityHouseCount, IEnumerable <Appliance> appliances, ITime clock)
        {
            _id         = ++communityHouseCount;
            _appliances = new Appliances(clock);
            _usage      = new PowerUsage();

            foreach (var appliance in appliances)
            {
                _appliances.Add(appliance);
            }
        }