public void should_set_bio_visibility() { var bio = new ArtistBioBuilder().With(i => i.Id, 3) .With(cr => cr.Owner, new UserBuilder().With(u => u.Id, "bob").BuildAndSave()) .With(b => b.OtherNames, "Artist Bob") .With(b => b.IsLive, false) .BuildAndSave(); var output = DomainRegistry.Repository.Execute(new SetArtistBioVisibility { UserId = bio.Owner.Id, IsVisible = true }); var editedBio = DataContext.AsQueryable <ArtistBio>().First(b => b.Owner.Id == bio.Owner.Id); Assert.That(editedBio.IsLive, Is.True); Assert.That(output, Is.EqualTo("You set your artist bio visibility to True.")); }
public void get_all_live_artist_bios() { var live_bio = new ArtistBioBuilder().With(i => i.Id, 3) .With(cr => cr.Owner, new UserBuilder().With(u => u.Id, "bob").BuildAndSave()) .With(b => b.OtherNames, "Artist Bob") .With(b => b.IsLive, true) .BuildAndSave(); new ArtistBioBuilder().With(i => i.Id, 4) .With(cr => cr.Owner, new UserBuilder().With(u => u.Id, "tom").BuildAndSave()) .With(b => b.OtherNames, "Artist Tom") .With(b => b.IsLive, false) .BuildAndSave(); var bios = DomainRegistry.Repository.Find(new GetArtistBios()).ToArray(); Assert.That(bios, Has.Exactly(1).Items); Assert.That(bios[0].Id, Is.EqualTo(live_bio.Id)); }