public void WhenIdsDiffer_AddBoth() { var merger = new BegrippenMerger(); merger.AddBegrip(new Begrip( 121, "Hallo" )); merger.AddBegrip(new Begrip( 122, "Ballo" )); merger.BegripCount().ShouldBe(2); merger.Begrip(121).Naam.ShouldBe("Hallo"); merger.Begrip(122).Naam.ShouldBe("Ballo"); }
public void Merge_MatchingIds_ReplaceFilm() { var merger = new BegrippenMerger(); var begrip1 = new Begrip( 1, "Naam", "Film" ); merger.AddBegrip(begrip1); var begrip2 = new Begrip(1, "Naam", "NieuweFilm"); merger.AddBegrip(begrip2); merger.Begrip(1).Film.FileName.ShouldBe("NieuweFilm"); }
public void WhenIdsMatchAndFotosDiffer_AddFoto() { const int BEGRIPID = 1; var merger = new BegrippenMerger(); merger.AddBegrip(new Begrip( BEGRIPID, "Hallo" )); var begrip2 = new Begrip(BEGRIPID, "Ballo"); begrip2.AddFoto("Groet.bmp"); merger.AddBegrip(begrip2); merger.BegripCount().ShouldBe(1); merger.Begrip(BEGRIPID).Naam.ShouldBe("Ballo"); merger.Begrip(BEGRIPID).Foto(0).ShouldBe (new Foto(BEGRIPID, "Groet.bmp")); }
public void WhenIdsMatchAndFotosMatch_IgnoreFoto() { var merger = new BegrippenMerger(); var begrip1 = new Begrip( 121, "Hallo" ); begrip1.AddFoto("Groet.bmp"); merger.AddBegrip(begrip1); var begrip2 = new Begrip(121, "Ballo"); begrip2.AddFoto("Groet.bmp"); merger.AddBegrip(begrip2); merger.BegripCount().ShouldBe(1); merger.Begrip(121).Naam.ShouldBe("Ballo"); merger.Begrip(121).FotoCount().ShouldBe(1); }
public void WhenIdsMatch_ReplaceName() { var merger = new BegrippenMerger(); merger.AddBegrip(new Begrip( 121, "Hallo" )); merger.AddBegrip(new Begrip( 121, "Ballo" )); merger.Begrip(121).Naam.ShouldBe("Ballo"); }