Exemplo n.º 1
0
        public void ShouldReturnErrorIfIPassNullFileName()
        {
            // arrange
            LoadSchematicRequest request        = null;
            ISchematicServices   implementation = null;
            var service = new SchematicServices(implementation);

            // act
            Assert.Throws <System.ArgumentNullException>(() => service.LoadSchematicFromFile(request));
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
 public SchematicServices(ISchematicServices services)
 {
     this.services = services;
 }