public void ShouldThrowExceptionWhenSomeoneTriesToRemoveFromNinjas() { var immutableNinjas = new ImmutableNinjas(new List <Ninja> { new Ninja("N1"), new Ninja("N2") }); var immutableNinjasAll = immutableNinjas.All; immutableNinjasAll.Remove(new Ninja("N1")); }
public void ShouldBeAbleToCreateNinjaCollection() { var immutableNinjas = new ImmutableNinjas(new List <Ninja> { new Ninja("N1"), new Ninja("N2") }); var immutableNinjasAll = immutableNinjas.All; Assert.AreEqual(2, immutableNinjasAll.Count()); Assert.AreEqual("N1", immutableNinjasAll.Ninjas[0].Name); Assert.AreEqual("N2", immutableNinjasAll.Ninjas[1].Name); }