public void ToggleFavourite_NotifiesOfPropertyChangedForIsFavourite_Test()
        {
            var model = new SnpViewModel(TestSnpModel.Create(), null);

            model.CreatePropertyChangedObserver()
            .ExpectPropertyChanged(x => x.IsFavourite)
            .Verify(x => x.ToggleIsFavourite());
        }
 private bool MatchesIdentifier(string filter, SnpViewModel item)
 {
     if (String.IsNullOrWhiteSpace(filter))
     {
         return(true);
     }
     return(item.Id.Contains(filter, StringComparison.CurrentCultureIgnoreCase));
 }
        public void ToggleFavourite_UpdatesIsFavouriteProperty_Test()
        {
            var model    = new SnpViewModel(TestSnpModel.Create(), null);
            var expected = !model.IsFavourite;

            model.ToggleIsFavourite();

            Assert.Equal(expected, model.IsFavourite);
        }
        private SnpViewModel MakeSnpViewModel(SnpModel aa, SnpModel bb)
        {
            var snp = new SnpViewModel(aa, bb)
            {
                IsFavourite = _favouritesManager.Get((aa ?? bb).Id)
            };

            snp.PropertyChanged += OnSnpPropertyChanged;
            return(snp);
        }
        public void Ctor_WhenBIsNull_CorrectlyInitializesMembers_Test()
        {
            var a = TestSnpModel.Create();

            var actual = new SnpViewModel(a, null);

            Assert.Equal(a.Id, actual.Id);
            Assert.Equal(a.Location, actual.Location);
            Assert.Equal(a.Position, actual.Position);
            Assert.Equal(a.Genotype, actual.GenotypeA);
            Assert.Null(actual.GenotypeB);
            Assert.Null(actual.IsSame);
        }
        public void Ctor_WhenBIsDifferentToA_CorrectlyInitializesMembers_Test()
        {
            var a = TestSnpModel.Create(genotype: "AA");
            var b = TestSnpModel.Create(genotype: "AB");

            var actual = new SnpViewModel(a, b);

            Assert.Equal(a.Id, actual.Id);
            Assert.Equal(a.Location, actual.Location);
            Assert.Equal(a.Position, actual.Position);
            Assert.Equal(a.Genotype, actual.GenotypeA);
            Assert.Equal(b.Genotype, actual.GenotypeB);
            Assert.False(actual.IsSame.Value);
        }