private HandleFileAccess ( System.Action loadFile, string fileName ) : bool | ||
loadFile | System.Action | |
fileName | string | |
Результат | bool |
public void HandleFileAccess_SuppliedActionThrows_Exception_ReturnsException() { // arrange var persistence = new FilePersistance(_mockCommandLine.Object, _mockLogger.Object); // act var expected = new Exception(); var actual = Assert.Throws<Exception>(() => persistence.HandleFileAccess(() => { throw expected; }, "file_name")); // assert Assert.AreSame(expected, actual); }
public void HandleFileAccess_SuppliedActionThrows_Exception_ReturnsFalse(Type exception) { // arrange var persistence = new FilePersistance(_mockCommandLine.Object, _mockLogger.Object); // act Assert.IsFalse(persistence.HandleFileAccess(() => { throw (Exception) Activator.CreateInstance(exception); }, "file_name")); }
public void HandleFileAccess_SuppliedActionSuccess_ReturnsTrue() { // arrange var persistence = new FilePersistance(_mockCommandLine.Object, _mockLogger.Object); // act Assert.IsTrue(persistence.HandleFileAccess(() => { }, "file_name")); }