Exemplo n.º 1
0
        public void Command_Throws_If_Artist_Is_Missing(
            Guid albumId,
            string category,
            CheckoutRequest checkout,
            CompletionStatusReference completionStatus,
            string countryOfOrigin,
            string countryPurchased,
            DateTimeOffset purchasedOn,
            int discogsId,
            string genre,
            bool hasDigitalDownload,
            string imageUrl,
            bool isNewPurchase,
            bool isPhysical,
            bool isReissue,
            ItemStorageRequest itemStorage,
            string locationPurchased,
            MediaTypeReference mediaType,
            string notes,
            string recordLabel,
            int?reissueYear,
            SizeReference size,
            SpeedReference speed,
            string style,
            int timesCompleted,
            string title,
            int yearReleasedOn)
        {
            Action createWithMissingArtist = () => new AlbumUpdateCommand(
                albumId,
                string.Empty,
                category,
                checkout,
                completionStatus,
                countryOfOrigin,
                countryPurchased,
                discogsId,
                genre,
                hasDigitalDownload,
                imageUrl,
                isNewPurchase,
                isPhysical,
                isReissue,
                itemStorage,
                locationPurchased,
                mediaType,
                notes,
                purchasedOn,
                recordLabel,
                reissueYear,
                size,
                speed,
                style,
                timesCompleted,
                title,
                yearReleasedOn,
                _testUser);

            createWithMissingArtist.Should().Throw <ArgumentException>();
        }
Exemplo n.º 2
0
        public void Request_Throws_If_ReissueYear_Is_Negative_And_IsReissue_Is_True(
            string artist,
            string category,
            CheckoutRequest checkout,
            CompletionStatusReference completionStatus,
            string countryOfOrigin,
            string countryPurchased,
            DateTimeOffset purchasedOn,
            int discogsId,
            string genre,
            bool hasDigitalDownload,
            string imageUrl,
            bool isNewPurchase,
            bool isPhysical,
            ItemStorageRequest itemStorage,
            string locationPurchased,
            MediaTypeReference mediaType,
            string notes,
            string recordLabel,
            SizeReference size,
            SpeedReference speed,
            string style,
            int timesCompleted,
            string title,
            int yearReleasedOn)
        {
            Action createWithNegativeReissueYearWhenIsReissueIsTrue = () => new AlbumSubmissionRequest(
                artist,
                category,
                checkout,
                completionStatus,
                countryOfOrigin,
                countryPurchased,
                discogsId,
                genre,
                hasDigitalDownload,
                imageUrl,
                isNewPurchase,
                isPhysical,
                true,
                itemStorage,
                locationPurchased,
                mediaType,
                notes,
                purchasedOn,
                recordLabel,
                -1,
                size,
                speed,
                style,
                timesCompleted,
                title,
                yearReleasedOn,
                _testUser);

            createWithNegativeReissueYearWhenIsReissueIsTrue.Should().Throw <ArgumentException>();
        }
Exemplo n.º 3
0
        //each of the following functions creates a list to be shown in the dropdown
        public List <SizeReference> GetSizeReferences()
        {
            List <SizeReference> sizes = new List <SizeReference>();

            SizeReference sizeRef = new SizeReference();

            sizeRef.cd    = "00";
            sizeRef.descr = "Choose a size";

            sizes.Add(sizeRef);

            SizeReference sizeRef1 = new SizeReference();

            sizeRef1.cd    = "S";
            sizeRef1.descr = "Small";

            sizes.Add(sizeRef1);

            SizeReference sizeRef2 = new SizeReference();

            sizeRef2.cd    = "M";
            sizeRef2.descr = " Medium";

            sizes.Add(sizeRef2);

            SizeReference sizeRef3 = new SizeReference();

            sizeRef3.cd    = "L";
            sizeRef3.descr = "Large";

            sizes.Add(sizeRef3);

            SizeReference sizeRef4 = new SizeReference();

            sizeRef4.cd    = "XL";
            sizeRef4.descr = "XL";

            sizes.Add(sizeRef4);

            SizeReference sizeRef5 = new SizeReference();

            sizeRef5.cd    = "2XL";
            sizeRef5.descr = "2XL";

            sizes.Add(sizeRef5);

            SizeReference sizeRef6 = new SizeReference();

            sizeRef6.cd    = "3XL";
            sizeRef6.descr = "3XL";

            sizes.Add(sizeRef6);

            return(sizes);
        }
Exemplo n.º 4
0
        public AlbumUpdateCommand(
            Guid albumId,
            string artist,
            string category,
            CheckoutRequest checkout,
            CompletionStatusReference completionStatus,
            string countryOfOrigin,
            string countryPurchased,
            int discogsId,
            string genre,
            bool hasDigitalDownload,
            string imageUrl,
            bool isNew,
            bool isPhysical,
            bool isReissue,
            ItemStorageRequest itemStorage,
            string locationPurchased,
            MediaTypeReference mediaType,
            string notes,
            DateTimeOffset purchasedOn,
            string recordLabel,
            int?reissueYear,
            SizeReference size,
            SpeedReference speed,
            string style,
            int timesCompleted,
            string title,
            int yearReleasedOn,
            ApplicationUser user)
        {
            Guard.Against.Default(albumId, nameof(albumId));
            Guard.Against.NullOrWhiteSpace(artist, nameof(artist));
            Guard.Against.NullOrWhiteSpace(title, nameof(title));
            Guard.Against.Null(user, nameof(user));
            Guard.Against.Default(user.Id, nameof(user.Id));

            AlbumId            = albumId;
            Artist             = artist;
            Category           = category;
            Checkout           = checkout;
            CompletionStatus   = completionStatus;
            CountryOfOrigin    = countryOfOrigin;
            CountryPurchased   = countryPurchased;
            DiscogsId          = discogsId;
            Genre              = genre;
            HasDigitalDownload = hasDigitalDownload;
            ImageUrl           = imageUrl;
            IsNew              = isNew;
            IsPhysical         = isPhysical;
            IsReissue          = isReissue;
            ItemStorage        = itemStorage;
            LocationPurchased  = locationPurchased;
            MediaType          = mediaType;
            Notes              = notes;
            PurchasedOn        = purchasedOn;
            RecordLabel        = recordLabel;
            ReissueYear        = reissueYear;
            Size           = size;
            Speed          = speed;
            Style          = style;
            TimesCompleted = timesCompleted;
            Title          = title;
            YearReleasedOn = yearReleasedOn;
            User           = user;
        }