public void ItShouldNotThrowAnError()
        {
            var x = new EnumerationAndFlags(StatesSample.One);

            Assert.Null(x.AllEnumerations);
            var json = JsonConvert.SerializeObject(x);
            var y    = JsonConvert.DeserializeObject <EnumerationAndFlags>(json);

            Assert.Single(y.SelectedKeys);
            Assert.Equal(StatesSample.One, StatesSample.GetInstanceFromKey(y.SelectedKeys.Last()));
            Assert.Null(x.AllEnumerations);
        }
        public void ItShouldNotThrowAnErrorWhenUnTyped()
        {
            var x = new EnumerationAndFlags(StatesSample.One, StatesSample.GetAllInstances().Cast <Enumeration>().ToList())
            {
                AllowMultipleSelections = true
            };

            x.AddFlag(StatesSample.Three);
            var json = JsonConvert.SerializeObject(x);
            var y    = JsonConvert.DeserializeObject <EnumerationAndFlags>(json);

            Assert.Equal(2, y.SelectedKeys.Count);
            Assert.Equal(StatesSample.Three, StatesSample.GetInstanceFromKey(y.SelectedKeys.Last()));
            Assert.Equal(3, y.AllEnumerations.Count);
            Assert.Equal(StatesSample.One, y.AllEnumerations.First());
        }