Exemplo n.º 1
0
 public void NewRecordDoesNotAddsValuesWhenTotalOver10()
 {
     var testrecord = new Website.Models.TestTable();
     testrecord.value1 = 9;
     testrecord.value2 = 5;
     _mockTestTableRepository.Setup(f => f.Insert(It.IsAny<Website.Models.TestTable>())).Returns(testrecord);
     var result = _testTableLogic.SaveOrUpdate(testrecord);
     Assert.True(result.Errors.ContainsValue("Total must be less than 10"));
 }
Exemplo n.º 2
0
 public void NewRecordAddsValues()
 {
     var testrecord = new Website.Models.TestTable();
     testrecord.value1 = 3;
     testrecord.value2 = 5;
     _mockTestTableRepository.Setup(f => f.Insert(It.IsAny<Website.Models.TestTable>())).Returns(testrecord);
     var result = _testTableLogic.SaveOrUpdate(testrecord);
     Assert.True(result.CalculatedTotal == 8);
 }