public void DeleteTable_ExceptionFromDataAccess() { //Arange var mock = new Mock <IManagerDataAccess>(); mock.Setup(m => m.RemoveTable(It.IsAny <int>())).Throws(new Exception()); var BarDataModel = new BarDataModel(mock.Object); //Act var result = BarDataModel.DeleteTable(1); //Assert Assert.IsFalse(result); }
public void DeleteTable_FailedDeletingFromDataAccess() { //Arange var mock = new Mock <IManagerDataAccess>(); mock.Setup(m => m.RemoveTable(It.IsAny <int>())).Returns(false); var BarDataModel = new BarDataModel(mock.Object); //Act var result = BarDataModel.DeleteTable(1); //Assert Assert.IsFalse(result); }
public void DeleteTable_ValidExample() { //Arange var mock = new Mock <IManagerDataAccess>(); mock.Setup(m => m.RemoveTable(It.IsAny <int>())).Returns(true); var BarDataModel = new BarDataModel(mock.Object); //Act var result = BarDataModel.DeleteTable(1); //Assert Assert.IsTrue(result); }
public void DeleteTable_ValidExample() { //Arange var mock = new Mock<IManagerDataAccess>(); mock.Setup(m => m.RemoveTable(It.IsAny<int>())).Returns(true); var BarDataModel = new BarDataModel(mock.Object); //Act var result = BarDataModel.DeleteTable(1); //Assert Assert.IsTrue(result); }
public void DeleteTable_FailedDeletingFromDataAccess() { //Arange var mock = new Mock<IManagerDataAccess>(); mock.Setup(m => m.RemoveTable(It.IsAny<int>())).Returns(false); var BarDataModel = new BarDataModel(mock.Object); //Act var result = BarDataModel.DeleteTable(1); //Assert Assert.IsFalse(result); }
public void DeleteTable_ExceptionFromDataAccess() { //Arange var mock = new Mock<IManagerDataAccess>(); mock.Setup(m => m.RemoveTable(It.IsAny<int>())).Throws(new Exception()); var BarDataModel = new BarDataModel(mock.Object); //Act var result = BarDataModel.DeleteTable(1); //Assert Assert.IsFalse(result); }