public void CreateGroup_EstimateCosts(int squareMeters, int expected)
        {
            IEnumerable <ProportionalPainter> sequenceOfPainters = new List <ProportionalPainter>
            {
                new ProportionalPainter(TimeSpan.FromMinutes(10), 4, true),
                new ProportionalPainter(TimeSpan.FromMinutes(5), 8, true)
            };
            var paintingGroup = CompositePainterFactory.CreateGroup(sequenceOfPainters);
            int result        = paintingGroup.EstimateCosts(squareMeters);

            Assert.That(result, Is.EqualTo(expected));
        }
        public void CreateGroup_OnePainterIsAvailable_Available()
        {
            IList <ProportionalPainter> sequenceOfPainters = new List <ProportionalPainter>
            {
                new ProportionalPainter(TimeSpan.FromMinutes(6), 30, false),
                new ProportionalPainter(TimeSpan.FromMinutes(12), 15, true)
            };
            var  sut    = CompositePainterFactory.CreateGroup(sequenceOfPainters);
            bool result = sut.IsAvailable;

            Assert.That(result, Is.EqualTo(true));
        }
        public void CreateGroup_EstimateCosts_Easy()
        {
            int squareMeters = 10;
            IList <ProportionalPainter> sequenceOfPainters = new List <ProportionalPainter>
            {
                new ProportionalPainter(TimeSpan.FromMinutes(6), 30, true),
                new ProportionalPainter(TimeSpan.FromMinutes(12), 15, true)
            };
            var sut    = CompositePainterFactory.CreateGroup(sequenceOfPainters);
            int result = sut.EstimateCosts(squareMeters);

            Assert.That(result, Is.EqualTo(30));
        }
        public void CreateGroup_EstimateDuration_Medium()
        {
            int squareMeters = 72;
            IList <ProportionalPainter> sequenceOfPainters = new List <ProportionalPainter>
            {
                new ProportionalPainter(TimeSpan.FromMinutes(6), 3, true),
                new ProportionalPainter(TimeSpan.FromMinutes(15), 8, true)
            };
            var      sut    = CompositePainterFactory.CreateGroup(sequenceOfPainters);
            TimeSpan result = sut.EstimateDuration(squareMeters);

            Assert.That(result, Is.EqualTo(TimeSpan.FromMinutes(309)));
        }
        public void CreateFastestSelector_EstimateCosts()
        {
            IEnumerable <IPainter> sequenceOfPainters = new List <IPainter>
            {
                new ProportionalPainter(TimeSpan.FromMinutes(30), 3, true),
                new ProportionalPainter(TimeSpan.FromMinutes(10), 8, true),
                new ProportionalPainter(TimeSpan.FromMinutes(15), 7, false),
                new ProportionalPainter(TimeSpan.FromMinutes(60), 5, true),
                new ProportionalPainter(TimeSpan.FromMinutes(6), 1, false)
            };
            var fastestPainter = CompositePainterFactory.CreateFastestSelector(sequenceOfPainters, 10);
            var result         = fastestPainter.EstimateCosts(10);

            Assert.That(result, Is.EqualTo(13));
        }