Beispiel #1
0
        public SingleShirt CreateShirt()
        {
            string color  = colors.GetValue(rand.Next(0, colors.Length)).ToString();
            string size   = sizes.GetValue(rand.Next(0, sizes.Length)).ToString();
            string length = lengths.GetValue(rand.Next(0, lengths.Length)).ToString();
            string gender = genders.GetValue(rand.Next(0, genders.Length)).ToString();

            SingleShirt shirt = new SingleShirt(color, size, length, gender);

            CreatedShirts.Add(shirt.GetName());
            return(shirt);
        }
Beispiel #2
0
        public string ConvertToJson(SingleShirt shirt)
        {
            string jsonPant = JsonConvert.SerializeObject(shirt);

            return(jsonPant);
        }