Esempio n. 1
0
        public void FilterHandValueModelSerializeTest()
        {
            var filterHandValueModelExpected = new FilterHandValueModel();

            filterHandValueModelExpected.Initialize();

            var fastFilterItem = filterHandValueModelExpected.FastFilterCollection.FirstOrDefault();

            fastFilterItem.CurrentTriState = Model.Enums.EnumTriState.Off;

            var flopHandValueItem = filterHandValueModelExpected.FlopHandValuesCollection.FirstOrDefault();

            flopHandValueItem.IsChecked = true;

            var turnHandValueItem = filterHandValueModelExpected.TurnHandValuesCollection.FirstOrDefault();

            turnHandValueItem.IsChecked = true;

            var riverHandValueItem = filterHandValueModelExpected.RiverHandValuesCollection.FirstOrDefault();

            riverHandValueItem.IsChecked = true;

            var filterHandValueModelActual = SerializerHelper.GetXmlSerializedDeserializedObject(filterHandValueModelExpected);

            Assert.That(filterHandValueModelActual.Id, Is.EqualTo(filterHandValueModelExpected.Id));
            Assert.That(filterHandValueModelActual.Type, Is.EqualTo(filterHandValueModelExpected.Type));

            Assert.That(filterHandValueModelActual.FastFilterCollection.Count, Is.EqualTo(filterHandValueModelExpected.FastFilterCollection.Count));
            Assert.That(filterHandValueModelActual.FastFilterCollection.Count(x => x.CurrentTriState != Model.Enums.EnumTriState.Any), Is.EqualTo(filterHandValueModelExpected.FastFilterCollection.Count(x => x.CurrentTriState != Model.Enums.EnumTriState.Any)));

            Assert.That(filterHandValueModelActual.FlopHandValuesCollection.Count, Is.EqualTo(filterHandValueModelExpected.FlopHandValuesCollection.Count));
            Assert.That(filterHandValueModelActual.FlopHandValuesCollection.Count(x => x.IsChecked), Is.EqualTo(filterHandValueModelExpected.FlopHandValuesCollection.Count(x => x.IsChecked)));

            Assert.That(filterHandValueModelActual.TurnHandValuesCollection.Count, Is.EqualTo(filterHandValueModelExpected.TurnHandValuesCollection.Count));
            Assert.That(filterHandValueModelActual.TurnHandValuesCollection.Count(x => x.IsChecked), Is.EqualTo(filterHandValueModelExpected.TurnHandValuesCollection.Count(x => x.IsChecked)));

            Assert.That(filterHandValueModelActual.RiverHandValuesCollection.Count, Is.EqualTo(filterHandValueModelExpected.RiverHandValuesCollection.Count));
            Assert.That(filterHandValueModelActual.RiverHandValuesCollection.Count(x => x.IsChecked), Is.EqualTo(filterHandValueModelExpected.RiverHandValuesCollection.Count(x => x.IsChecked)));
        }
Esempio n. 2
0
        public void HudBumperStickerTypeFilterModelCollectionSerializeTest()
        {
            var filterHoleCardsModelExpected = new FilterHoleCardsModel();

            filterHoleCardsModelExpected.Initialize();

            var filterHandValueModel = new FilterHandValueModel();

            filterHandValueModel.Initialize();

            var filterHandActionModelExpected = new FilterHandActionModel();

            filterHandActionModelExpected.Initialize();

            var hudBumperStickerTypeExpected = new HudBumperStickerType();

            hudBumperStickerTypeExpected.FilterModelCollection = new IFilterModelCollection {
                filterHoleCardsModelExpected, filterHandValueModel, filterHandActionModelExpected
            };

            var hudBumperStickerTypeActual = SerializerHelper.GetXmlSerializedDeserializedObject(hudBumperStickerTypeExpected);

            Assert.That(hudBumperStickerTypeActual.FilterModelCollection.Count, Is.EqualTo(hudBumperStickerTypeExpected.FilterModelCollection.Count));
        }