From cb42ebc8c125bdb94601650b4645b6bc59420891 Mon Sep 17 00:00:00 2001 From: Mike Bierlee Date: Sun, 25 Jan 2015 21:55:02 +0100 Subject: [PATCH] Update copyrights --- LICENSE.txt | 38 ++++---- README.md | 2 +- source/poodinis/autowire.d | 2 +- source/poodinis/container.d | 2 +- source/poodinis/dependency.d | 2 +- source/poodinis/registration.d | 2 +- test/poodinis/autowiretest.d | 2 +- test/poodinis/containertest.d | 2 +- test/poodinis/registrationtest.d | 160 +++++++++++++++---------------- 9 files changed, 106 insertions(+), 106 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index b313588..cf6bb88 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,19 +1,19 @@ -Copyright (c) 2014 Mike Bierlee - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file +Copyright (c) 2014-2015 Mike Bierlee + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md index 0c2f348..23b5a72 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Poodinis Dependency Injection Framework ======================================= Version 0.3.1 -Copyright 2014 Mike Bierlee +Copyright 2014-2015 Mike Bierlee Licensed under the terms of the MIT license - See [LICENSE.txt](LICENSE.txt) [![Build Status](https://api.travis-ci.org/mbierlee/poodinis.png)](https://travis-ci.org/mbierlee/poodinis) diff --git a/source/poodinis/autowire.d b/source/poodinis/autowire.d index 1870c86..b602471 100644 --- a/source/poodinis/autowire.d +++ b/source/poodinis/autowire.d @@ -1,6 +1,6 @@ /** * Poodinis Dependency Injection Framework - * Copyright 2014 Mike Bierlee + * Copyright 2014-2015 Mike Bierlee * This software is licensed under the terms of the MIT license. * The full terms of the license can be found in the LICENSE file. */ diff --git a/source/poodinis/container.d b/source/poodinis/container.d index 827ce3f..03c723c 100644 --- a/source/poodinis/container.d +++ b/source/poodinis/container.d @@ -1,6 +1,6 @@ /** * Poodinis Dependency Injection Framework - * Copyright 2014 Mike Bierlee + * Copyright 2014-2015 Mike Bierlee * This software is licensed under the terms of the MIT license. * The full terms of the license can be found in the LICENSE file. */ diff --git a/source/poodinis/dependency.d b/source/poodinis/dependency.d index 82c05f7..14a0d83 100644 --- a/source/poodinis/dependency.d +++ b/source/poodinis/dependency.d @@ -1,6 +1,6 @@ /** * Poodinis Dependency Injection Framework - * Copyright 2014 Mike Bierlee + * Copyright 2014-2015 Mike Bierlee * This software is licensed under the terms of the MIT license. * The full terms of the license can be found in the LICENSE file. */ diff --git a/source/poodinis/registration.d b/source/poodinis/registration.d index 0989489..6bcec83 100644 --- a/source/poodinis/registration.d +++ b/source/poodinis/registration.d @@ -1,6 +1,6 @@ /** * Poodinis Dependency Injection Framework - * Copyright 2014 Mike Bierlee + * Copyright 2014-2015 Mike Bierlee * This software is licensed under the terms of the MIT license. * The full terms of the license can be found in the LICENSE file. */ diff --git a/test/poodinis/autowiretest.d b/test/poodinis/autowiretest.d index b45985b..7501ed5 100644 --- a/test/poodinis/autowiretest.d +++ b/test/poodinis/autowiretest.d @@ -1,6 +1,6 @@ /** * Poodinis Dependency Injection Framework - * Copyright 2014 Mike Bierlee + * Copyright 2014-2015 Mike Bierlee * This software is licensed under the terms of the MIT license. * The full terms of the license can be found in the LICENSE file. */ diff --git a/test/poodinis/containertest.d b/test/poodinis/containertest.d index 1632655..ba0300e 100644 --- a/test/poodinis/containertest.d +++ b/test/poodinis/containertest.d @@ -1,6 +1,6 @@ /** * Poodinis Dependency Injection Framework - * Copyright 2014 Mike Bierlee + * Copyright 2014-2015 Mike Bierlee * This software is licensed under the terms of the MIT license. * The full terms of the license can be found in the LICENSE file. */ diff --git a/test/poodinis/registrationtest.d b/test/poodinis/registrationtest.d index d3f318f..300ca09 100644 --- a/test/poodinis/registrationtest.d +++ b/test/poodinis/registrationtest.d @@ -1,80 +1,80 @@ -/** - * Poodinis Dependency Injection Framework - * Copyright 2014 Mike Bierlee - * This software is licensed under the terms of the MIT license. - * The full terms of the license can be found in the LICENSE file. - */ - -import poodinis.registration; - -import std.exception; - -version(unittest) { - class TestType { - } - - // Test getting instance without scope defined throws exception - unittest { - Registration registration = new Registration(null, null); - registration.registeredType = typeid(TestType); - assertThrown!(NoScopeDefinedException)(registration.getInstance()); - } - - // Test getting instance from single instance scope - unittest { - Registration registration = new Registration(null, null); - registration.registationScope = new SingleInstanceScope(typeid(TestType)); - auto instance1 = registration.getInstance(); - auto instance2 = registration.getInstance(); - assert(instance1 is instance2, "Registration with single instance scope did not return the same instance"); - } - - // Test set single instance scope using scope setter - unittest { - Registration registration = new Registration(null, typeid(TestType)); - auto chainedRegistration = registration.singleInstance(); - auto instance1 = registration.getInstance(); - auto instance2 = registration.getInstance(); - assert(instance1 is instance2, "Registration with single instance scope did not return the same instance"); - assert(registration is chainedRegistration, "Registration returned by scope setting is not the same as the registration being set"); - } - - // Test getting instance from new instance scope - unittest { - Registration registration = new Registration(null, null); - registration.registationScope = new NewInstanceScope(typeid(TestType)); - auto instance1 = registration.getInstance(); - auto instance2 = registration.getInstance(); - assert(instance1 !is instance2, "Registration with new instance scope did not return a different instance"); - } - - // Test set new instance scope using scope setter - unittest { - Registration registration = new Registration(null, typeid(TestType)); - auto chainedRegistration = registration.newInstance(); - auto instance1 = registration.getInstance(); - auto instance2 = registration.getInstance(); - assert(instance1 !is instance2, "Registration with new instance scope did not return a different instance"); - assert(registration is chainedRegistration, "Registration returned by scope setting is not the same as the registration being set"); - } - - // Test getting instance from existing instance scope - unittest { - Registration registration = new Registration(null, null); - TestType expectedInstance = new TestType(); - registration.registationScope = new ExistingInstanceScope(expectedInstance); - auto actualInstance = registration.getInstance(); - assert(expectedInstance is actualInstance, "Registration with existing instance did not return given instance"); - } - - // Test set existing instance scope using scope setter - unittest { - Registration registration = new Registration(null, null); - auto expectedInstance = new TestType(); - auto chainedRegistration = registration.existingInstance(expectedInstance); - auto actualInstance = registration.getInstance(); - assert(expectedInstance is expectedInstance, "Registration with existing instance scope did not return the same instance"); - assert(registration is chainedRegistration, "Registration returned by scope setting is not the same as the registration being set"); - } - -} \ No newline at end of file +/** + * Poodinis Dependency Injection Framework + * Copyright 2014-2015 Mike Bierlee + * This software is licensed under the terms of the MIT license. + * The full terms of the license can be found in the LICENSE file. + */ + +import poodinis.registration; + +import std.exception; + +version(unittest) { + class TestType { + } + + // Test getting instance without scope defined throws exception + unittest { + Registration registration = new Registration(null, null); + registration.registeredType = typeid(TestType); + assertThrown!(NoScopeDefinedException)(registration.getInstance()); + } + + // Test getting instance from single instance scope + unittest { + Registration registration = new Registration(null, null); + registration.registationScope = new SingleInstanceScope(typeid(TestType)); + auto instance1 = registration.getInstance(); + auto instance2 = registration.getInstance(); + assert(instance1 is instance2, "Registration with single instance scope did not return the same instance"); + } + + // Test set single instance scope using scope setter + unittest { + Registration registration = new Registration(null, typeid(TestType)); + auto chainedRegistration = registration.singleInstance(); + auto instance1 = registration.getInstance(); + auto instance2 = registration.getInstance(); + assert(instance1 is instance2, "Registration with single instance scope did not return the same instance"); + assert(registration is chainedRegistration, "Registration returned by scope setting is not the same as the registration being set"); + } + + // Test getting instance from new instance scope + unittest { + Registration registration = new Registration(null, null); + registration.registationScope = new NewInstanceScope(typeid(TestType)); + auto instance1 = registration.getInstance(); + auto instance2 = registration.getInstance(); + assert(instance1 !is instance2, "Registration with new instance scope did not return a different instance"); + } + + // Test set new instance scope using scope setter + unittest { + Registration registration = new Registration(null, typeid(TestType)); + auto chainedRegistration = registration.newInstance(); + auto instance1 = registration.getInstance(); + auto instance2 = registration.getInstance(); + assert(instance1 !is instance2, "Registration with new instance scope did not return a different instance"); + assert(registration is chainedRegistration, "Registration returned by scope setting is not the same as the registration being set"); + } + + // Test getting instance from existing instance scope + unittest { + Registration registration = new Registration(null, null); + TestType expectedInstance = new TestType(); + registration.registationScope = new ExistingInstanceScope(expectedInstance); + auto actualInstance = registration.getInstance(); + assert(expectedInstance is actualInstance, "Registration with existing instance did not return given instance"); + } + + // Test set existing instance scope using scope setter + unittest { + Registration registration = new Registration(null, null); + auto expectedInstance = new TestType(); + auto chainedRegistration = registration.existingInstance(expectedInstance); + auto actualInstance = registration.getInstance(); + assert(expectedInstance is expectedInstance, "Registration with existing instance scope did not return the same instance"); + assert(registration is chainedRegistration, "Registration returned by scope setting is not the same as the registration being set"); + } + +}