public void TestCoupleOfVariants()
        {
            string twoVariantProduct = @"
            [
                {
                    ""node"": {
                      ""title"": ""Black / Small"",
                      ""selectedOptions"": [
                        {
                          ""name"": ""Color"",
                          ""value"": ""Black""
                        },
                        {
                          ""name"": ""Size"",
                          ""value"": ""Small""
                        }
                      ]
                    }
                }
            ]";

            var selector = new VariantSelector(VariantsFromString(twoVariantProduct));
            var options  = selector.AllOptions();

            Assert.AreEqual(options.Count, 2);
            Assert.AreEqual(options["Color"], new List <string> {
                "Black"
            });
            Assert.AreEqual(options["Size"], new List <string> {
                "Small"
            });
        }
        public void TestAllOptions()
        {
            var selector = new VariantSelector(ManyVariants());
            var options  = selector.AllOptions();

            Assert.AreEqual(options.Count, 3);
            Assert.AreEqual(options["Color"], new List <string> {
                "Blue"
            });
            Assert.AreEqual(options["Size"], new List <string> {
                "Small", "Medium"
            });
            Assert.AreEqual(options["Language"], new List <string> {
                "English", "French"
            });
        }
        public void TestDefaultVariant()
        {
            string oneVariantProduct = @"
            [
                {
                    ""node"": {
                      ""title"": ""Default Title"",
                      ""selectedOptions"": [
                        {
                          ""name"": ""Title"",
                          ""value"": ""Default Title""
                        }
                      ]
                    }
                }
            ]";

            var selector = new VariantSelector(VariantsFromString(oneVariantProduct));
            var options  = selector.AllOptions();

            Assert.IsNull(options);
        }