public void FilterHoleCardsModelSerializeTest() { var filterHoleCardsModelExpected = new FilterHoleCardsModel(); filterHoleCardsModelExpected.Initialize(); var aaHoleCards = filterHoleCardsModelExpected.HoleCardsCollection.FirstOrDefault(x => x.Name == "AA"); Assert.IsNotNull(aaHoleCards); aaHoleCards.IsChecked = false; var filterHoleCardsModelActual = SerializerHelper.GetXmlSerializedDeserializedObject(filterHoleCardsModelExpected); Assert.That(filterHoleCardsModelActual.Id, Is.EqualTo(filterHoleCardsModelExpected.Id)); Assert.That(filterHoleCardsModelActual.Type, Is.EqualTo(filterHoleCardsModelExpected.Type)); Assert.That(filterHoleCardsModelActual.HoleCardsCollection.Count, Is.EqualTo(filterHoleCardsModelExpected.HoleCardsCollection.Count)); Assert.That(filterHoleCardsModelActual.HoleCardsCollection.Count(x => !x.IsChecked), Is.EqualTo(filterHoleCardsModelExpected.HoleCardsCollection.Count(x => !x.IsChecked))); }
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)); }