コード例 #1
0
 public void Can_Add_Circumstance_When_Initialized()
 {
     var insulin = new Insulin();
     insulin.SetOwner(factories.Object);
     insulin.InitializeCircumstances(new List<Guid>());
     insulin.AddCircumstance(circumstance);
     var circumstances = insulin.Circumstances;
     Assert.AreSame(circumstance, circumstances.Single());
 }
コード例 #2
0
 public void Can_Get_Circumstances_When_Initialized()
 {
     var defaultCircumstance = new InsulinCircumstance();
     factories.Setup(f => f.DefaultEntities.InsulinCircumstance).Returns(defaultCircumstance);
     var insulin = new Insulin();
     insulin.SetOwner(factories.Object);
     insulin.InitializeCircumstances(new List<Guid> { Guid.NewGuid(), circumstance.Id });
     var circumstances = insulin.Circumstances;
     Assert.AreEqual(2, circumstances.Count());
     Assert.AreSame(defaultCircumstance, circumstances.ElementAt(0));
     Assert.AreSame(circumstance, circumstances.ElementAt(1));
 }
コード例 #3
0
 public void Cannot_Delete_Circumstance_When_Not_Initialized()
 {
     var insulin = new Insulin();
     insulin.SetOwner(factories.Object);
     insulin.RemoveCircumstance(circumstance);
 }
コード例 #4
0
 public void Can_Remove_Circumstance_When_Initialized()
 {
     var insulin = new Insulin();
     insulin.SetOwner(factories.Object);
     insulin.InitializeCircumstances(new List<Guid> { circumstance.Id });
     insulin.RemoveCircumstance(circumstance);
     var circumstances = insulin.Circumstances;
     Assert.AreEqual(0, circumstances.Count());
 }