示例#1
0
        public MovieUpdateRequest(
            string category,
            CheckoutRequest checkout,
            CompletionStatusReference completionStatus,
            string countryOfOrigin,
            string countryPurchased,
            string director,
            string distributor,
            string genre,
            string imageUrl,
            bool isNew,
            bool isPhysical,
            bool isReissue,
            ItemStorageRequest itemStorage,
            string language,
            string locationPurchased,
            Guid movieId,
            string notes,
            DateTimeOffset purchasedOn,
            MovieRatingReference rating,
            int?reissueYear,
            int seasonNumber,
            int timesCompleted,
            string title,
            int tmdbId,
            MovieMediaTypeReference type,
            ApplicationUser user,
            int yearReleasedOn)
            : base(
                category,
                checkout,
                completionStatus,
                countryOfOrigin,
                countryPurchased,
                genre,
                imageUrl,
                isNew,
                isPhysical,
                isReissue,
                itemStorage,
                locationPurchased,
                notes,
                purchasedOn,
                reissueYear,
                timesCompleted,
                title,
                user,
                yearReleasedOn)
        {
            Guard.Against.Default(movieId, nameof(movieId));

            Director     = director;
            Distributor  = distributor;
            Language     = language;
            MovieId      = movieId;
            Rating       = rating;
            SeasonNumber = seasonNumber;
            TMDBId       = tmdbId;
            Type         = type;
        }
        public void Commmand_Throws_If_User_Id_Is_Missing(
            string category,
            CheckoutRequest checkout,
            CompletionStatusReference completionStatus,
            string countryOfOrigin,
            string countryPurchased,
            string director,
            string distributor,
            string genre,
            string imageUrl,
            bool isNew,
            bool isPhysical,
            bool isReissue,
            ItemStorageRequest itemStorage,
            string language,
            string locationPurchased,
            string notes,
            DateTimeOffset purchasedOn,
            MovieRatingReference rating,
            int?reissueYear,
            int seasonNumber,
            int timesCompleted,
            string title,
            int tmdbId,
            MovieMediaTypeReference type,
            int yearReleasedOn)
        {
            Action createWithMissingUserId = () => new MovieSubmissionCommand(
                category,
                checkout,
                completionStatus,
                countryOfOrigin,
                countryPurchased,
                director,
                distributor,
                genre,
                imageUrl,
                isNew,
                isPhysical,
                isReissue,
                itemStorage,
                language,
                locationPurchased,
                notes,
                purchasedOn,
                rating,
                reissueYear,
                seasonNumber,
                timesCompleted,
                title,
                tmdbId,
                type,
                new ApplicationUser {
                Id = Guid.Empty
            },
                yearReleasedOn);

            createWithMissingUserId.Should().Throw <ArgumentException>();
        }
        public void Request_Throws_If_ReissueYear_Is_Negative_And_IsReissue_Is_True(
            string category,
            CheckoutRequest checkout,
            CompletionStatusReference completionStatus,
            string countryOfOrigin,
            string countryPurchased,
            string director,
            string distributor,
            string genre,
            string imageUrl,
            bool isNew,
            bool isPhysical,
            ItemStorageRequest itemStorage,
            string language,
            string locationPurchased,
            Guid movieId,
            string notes,
            DateTimeOffset purchasedOn,
            MovieRatingReference rating,
            int seasonNumber,
            int timesCompleted,
            string title,
            int tmdbId,
            MovieMediaTypeReference type,
            int yearReleasedOn)
        {
            Action createWithNegativeReissueYearAndIsReissueTrue = () => new MovieUpdateRequest(
                category,
                checkout,
                completionStatus,
                countryOfOrigin,
                countryPurchased,
                director,
                distributor,
                genre,
                imageUrl,
                isNew,
                isPhysical,
                true,
                itemStorage,
                language,
                locationPurchased,
                movieId,
                notes,
                purchasedOn,
                rating,
                -1,
                seasonNumber,
                timesCompleted,
                title,
                tmdbId,
                type,
                _testUser,
                yearReleasedOn);

            createWithNegativeReissueYearAndIsReissueTrue.Should().Throw <ArgumentException>();
        }