示例#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));
        }
示例#2
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));
        }
示例#3
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);
        }