Beispiel #1
0
        public void Command_Throws_If_Title_Is_Missing(
            int bggId,
            string category,
            CheckoutRequest checkout,
            CompletionStatusReference completionStatus,
            string countryOfOrigin,
            string countryPurchased,
            string developer,
            Guid gameId,
            string genre,
            int giantBombId,
            string imageUrl,
            bool isDlc,
            bool isNew,
            bool isPhysical,
            bool isReissue,
            ItemStorageRequest itemStorage,
            string language,
            string locationPurchased,
            string notes,
            bool partOfSeries,
            GamePlatformReference platform,
            string publisher,
            DateTimeOffset purchasedOn,
            GameRatingReference rating,
            int?reissueYear,
            string series,
            int timesCompleted,
            GameTypeReference type,
            int yearReleasedOn)
        {
            Action createWithMissingTitle = () => new GameUpdateCommand(
                bggId,
                category,
                checkout,
                completionStatus,
                countryOfOrigin,
                countryPurchased,
                developer,
                gameId,
                genre,
                giantBombId,
                imageUrl,
                isDlc,
                isNew,
                isPhysical,
                isReissue,
                itemStorage,
                language,
                locationPurchased,
                notes,
                partOfSeries,
                platform,
                publisher,
                purchasedOn,
                rating,
                reissueYear,
                series,
                timesCompleted,
                string.Empty,
                type,
                _testUser,
                yearReleasedOn);

            createWithMissingTitle.Should().Throw <ArgumentException>();
        }
Beispiel #2
0
        public GameUpdateCommand(
            int bggId,
            string category,
            CheckoutRequest checkout,
            CompletionStatusReference completionStatus,
            string countryOfOrigin,
            string countryPurchased,
            string developer,
            Guid gameId,
            string genre,
            int giantBombId,
            string imageUrl,
            bool isDlc,
            bool isNew,
            bool isPhysical,
            bool isReissue,
            ItemStorageRequest itemStorage,
            string language,
            string locationPurchased,
            string notes,
            bool partOfSeries,
            GamePlatformReference platform,
            string publisher,
            DateTimeOffset purchasedOn,
            GameRatingReference rating,
            int?reissueYear,
            string series,
            int timesCompleted,
            string title,
            GameTypeReference 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(gameId, nameof(gameId));

            BGGId        = bggId;
            Developer    = developer;
            GameId       = gameId;
            GiantBombId  = giantBombId;
            IsDLC        = isDlc;
            Language     = language;
            PartOfSeries = partOfSeries;
            Platform     = platform;
            Publisher    = publisher;
            Rating       = rating;
            Series       = series;
            Type         = type;
        }
        public void Request_Throws_If_ReissueYear_Is_Null_And_IsReissue_Is_True(
            int bggId,
            string category,
            CheckoutRequest checkout,
            CompletionStatusReference completionStatus,
            string countryOfOrigin,
            string countryPurchased,
            string developer,
            string genre,
            int giantBombId,
            string imageUrl,
            bool isDlc,
            bool isNew,
            bool isPhysical,
            ItemStorageRequest itemStorage,
            string language,
            string locationPurchased,
            string notes,
            bool partOfSeries,
            GamePlatformReference platform,
            string publisher,
            DateTimeOffset purchasedOn,
            GameRatingReference rating,
            string series,
            int timesCompleted,
            string title,
            GameTypeReference type,
            int yearReleasedOn)
        {
            Action createWithNullReissueYearAndIsReissueTrue = () => new GameSubmissionRequest(
                bggId,
                category,
                checkout,
                completionStatus,
                countryOfOrigin,
                countryPurchased,
                developer,
                genre,
                giantBombId,
                imageUrl,
                isDlc,
                isNew,
                isPhysical,
                true,
                itemStorage,
                language,
                locationPurchased,
                notes,
                partOfSeries,
                platform,
                publisher,
                purchasedOn,
                rating,
                null,
                series,
                timesCompleted,
                title,
                type,
                _testUser,
                yearReleasedOn);

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