Ejemplo n.º 1
0
 public void WhenAssertingSomethingFalse()
 {
     Giv.n(AFalseyCondition);
     Wh.n(() => IExpressionThePreconditionWithMessage("A message"));
     Th.n(AnExceptionIsThrown)
     .And(() => TheExceptionIncludesTheMessage("A message"));
 }
Ejemplo n.º 2
0
        public IActionResult addWh(string sel, string title)
        {
            Wh w = new Wh {
                WhName = title, CourseId = int.Parse(sel)
            };

            db.Whs.Add(w);
            db.SaveChanges();
            return(Redirect("What"));
        }
Ejemplo n.º 3
0
 public void UnitOfWork_JustInsert()
 {
     _ernesto = new PersonCs
     {
         _id             = Guid.NewGuid(),
         Name            = "Ernesto",
         Age             = 31,
         FavouriteThings = new[] { "Pistachio Ice Cream", "Postgresql", "F#" }
     };
     Giv.n(() => AnOperation(Operation.Insert(_ernesto._id, _ernesto)));
     Wh.n(TheUnitOfWorkIsCommitted);
     Th.n(TheDocumentWasInserted);
 }
Ejemplo n.º 4
0
 public void ICanAddADocumentAndUpdateItAndTheChangesPersist()
 {
     Wh.n(IAddADocument)
     .And(IUpdateTheDocument);
     Th.n(TheChangePersists);
 }
Ejemplo n.º 5
0
 public void ICanAddADocumentAndDeleteItAndItsGone()
 {
     Wh.n(IAddADocument)
     .And(IDeleteTheDocument);
     Th.n(TheDocumentIsGone);
 }
Ejemplo n.º 6
0
 public void WhenAssertingSomethingTrue()
 {
     Giv.n(ATruthyCondition);
     Wh.n(() => IExpressionThePreconditionWithMessage("A message"));
     Th.n(AnExceptionIsNotThrown);
 }
Ejemplo n.º 7
0
 public void WhenAssertingSomethingWithMultipleConditions()
 {
     Giv.n(ATruthyCondition);
     Wh.n(() => IExpressionThePreconditionWithMessage("A message"));
     Th.n(ARequiresWithMultipleConditionsThrowsAnExceptionIfAnyConditionIsFalsey);
 }