Esempio n. 1
0
        public void Init_should_add_all_sizes()
        {
            Subject.Handle(new ApplicationStartedEvent());

            Mocker.GetMock <IQualitySizeRepository>()
            .Verify(v => v.Insert(It.IsAny <QualitySize>()), Times.Exactly(Quality.All().Count));
        }
        private static QualityProfileResource QualityToResource(QualityProfile profile)
        {
            return(new QualityProfileResource
            {
                Available = Quality.All()
                            .Where(c => !profile.Allowed.Any(q => c.Id == q.Id))
                            .InjectTo <List <QualityResource> >(),

                Allowed = profile.Allowed.InjectTo <List <QualityResource> >(),
                Name = profile.Name,
                Id = profile.Id
            });
        }
Esempio n. 3
0
        public void Init_should_insert_any_missing_sizes()
        {
            Mocker.GetMock <IQualitySizeRepository>()
            .Setup(s => s.All())
            .Returns(new List <QualitySize>
            {
                new QualitySize {
                    QualityId = 1, Name = "SDTV", MinSize = 0, MaxSize = 100
                }
            });

            Subject.Handle(new ApplicationStartedEvent());

            Mocker.GetMock <IQualitySizeRepository>()
            .Verify(v => v.Insert(It.IsAny <QualitySize>()), Times.Exactly(Quality.All().Count - 1));
        }