Beispiel #1
0
        public void ShouldBeCreateSession()
        {
            var room  = RoomBuilder.New().WithId(Guid.NewGuid()).Build();
            var movie = MovieBuilder.New().WithId(Guid.NewGuid()).Build();

            var sessionShould = new
            {
                SessionStart = _faker.Date.Recent(1),
                SessionEnd   = _faker.Date.Recent(1),
                TicketValue  = _faker.Finance.Amount(1, 200),
                Animation    = _faker.PickRandom <AnimationType>(),
                Audio        = _faker.PickRandom <AudioType>(),
                RoomId       = room.Id,
                MovieId      = movie.Id
            };

            var session = new Session(sessionShould.SessionStart, sessionShould.SessionEnd,
                                      sessionShould.TicketValue, sessionShould.Animation, sessionShould.Audio, sessionShould.MovieId, sessionShould.RoomId);

            sessionShould.ToExpectedObject().ShouldMatch(session);
        }
Beispiel #2
0
        public void ShouldbeNotCreateWithDescription(string description)
        {
            var movie = MovieBuilder.New().WithDescription(description).Build();

            movie.Notifications.Should().ContainSingle(e => e.Message == Resource.DescriptionMusteBeBetween3And500);
        }
Beispiel #3
0
        public void ShouldbeNotCreateWithTitle(string title)
        {
            var movie = MovieBuilder.New().WithTitle(title).Build();

            movie.Notifications.Should().ContainSingle(e => e.Message == Resource.TitleMustBeBetween3And250);
        }
Beispiel #4
0
        public void ShouldBeNotCreateWithImage(string image)
        {
            var movie = MovieBuilder.New().WithImage(image).Build();

            movie.Notifications.Should().ContainSingle(e => e.Message == Resource.ImageIsRequired);
        }
Beispiel #5
0
 public MovieRepositoryBuilder Find(Guid id)
 {
     _repository.Setup(r => r.GetById(It.IsAny <Guid>())).Returns(MovieBuilder.New().WithId(id).Build());
     return(this);
 }