Example #1
0
 public void AddMember_sets_band_property_on_member()
 {
     var band = new BandModel();
     var member = new Member();
     band.AddMember(member);
     Assert.AreSame(band, member.Band);
 }
Example #2
0
 public void AddAlbum_sets_band_property_on_album()
 {
     var band = new BandModel();
     var album = new Album();
     band.AddAlbum(album);
     Assert.AreSame(band, album.Band);
 }
Example #3
0
        public void Add_saves_to_database_and_sets_the_Id()
        {
            //arrange
            var band = new Band()
            {
                Name = "Love Cloaks",
                Photo = "/path/to/things.png",
                Bio = "This is the love cloaks band"
            };

            //act
            _repo.Add(band);
            _transaction.Commit();

            //assert
            Assert.NotNull(band.Id);
        }
Example #4
0
 public void Post([FromBody]string value)
 {
     var band = new Band()
     {
         Name = "Super Gnar",
         Photo = "/path/to/photo.jpg",
         Bio = "Yay!!!"
     };
     var band2 = new Band()
     {
         Name = "Ultra Gnar",
         Photo = "/path/to/ultragnar.jpg",
         Bio = "This gnar is gnar!!!"
     };
     _repo.Add(band);
     _repo.Add(band2);
 }
Example #5
0
 public void Add(Band band)
 {
     _session.Save(band);
 }
Example #6
0
 public void AddMember_increases_member_collection_by_one()
 {
     var band = new BandModel();
     band.AddMember(new Member());
     Assert.AreEqual(1, band.Members.Count);
 }
Example #7
0
 public void AddAlbum_increases_album_collection_by_one()
 {
     var band = new BandModel();
     band.AddAlbum(new Album());
     Assert.AreEqual(1, band.Albums.Count);
 }