public void ShouldReturnErrorIfIPassNullFileName() { // arrange LoadSchematicRequest request = null; ISchematicServices implementation = null; var service = new SchematicServices(implementation); // act Assert.Throws <System.ArgumentNullException>(() => service.LoadSchematicFromFile(request)); }
public void ShouldReturnErrorIfIPassBadFileName() { // arrange var request = new LoadSchematicRequest { Path = "goodFile.schematic" }; var badRequest = new LoadSchematicRequest { Path = "bad.schematic" }; ISchematicServices implementation = getServiceImplementation(request.Path); var service = new SchematicServices(implementation); // act Assert.Throws <System.IO.FileNotFoundException>(() => service.LoadSchematicFromFile(badRequest)); }
public void ShouldWorkInHappyCase() { // arrange var request = new LoadSchematicRequest { Path = "goodFile.schematic" }; ISchematicServices implementation = getServiceImplementation(request.Path); var service = new SchematicServices(implementation); // act var response = service.LoadSchematicFromFile(request); // assert Assert.IsTrue(response != null, "response should be defined"); implementation.Received().LoadSchematicFromFile(request.Path); }