mirror of
https://github.com/mbierlee/poodinis.git
synced 2024-11-15 04:04:01 +01:00
Fix typo registratedType -> registeredType
This commit is contained in:
parent
cc3c0d5f6d
commit
27d86ce8c7
|
@ -3,7 +3,7 @@ module poodinis.container;
|
||||||
import std.string;
|
import std.string;
|
||||||
|
|
||||||
struct Registration {
|
struct Registration {
|
||||||
TypeInfo registratedType = null;
|
TypeInfo registeredType = null;
|
||||||
TypeInfo_Class instantiatableType = null;
|
TypeInfo_Class instantiatableType = null;
|
||||||
|
|
||||||
public Object getInstance() {
|
public Object getInstance() {
|
||||||
|
@ -12,8 +12,8 @@ struct Registration {
|
||||||
}
|
}
|
||||||
|
|
||||||
class RegistrationException : Exception {
|
class RegistrationException : Exception {
|
||||||
this(string message, TypeInfo registratedType, TypeInfo_Class instantiatableType) {
|
this(string message, TypeInfo registeredType, TypeInfo_Class instantiatableType) {
|
||||||
super(format("Exception while registering type %s to %s: %s", registratedType.toString(), instantiatableType.name, message));
|
super(format("Exception while registering type %s to %s: %s", registeredType.toString(), instantiatableType.name, message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ class Container {
|
||||||
}
|
}
|
||||||
|
|
||||||
Registration newRegistration = { registeredType, instantiatableType };
|
Registration newRegistration = { registeredType, instantiatableType };
|
||||||
registrations[newRegistration.registratedType] = newRegistration;
|
registrations[newRegistration.registeredType] = newRegistration;
|
||||||
return newRegistration;
|
return newRegistration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ version(unittest) {
|
||||||
unittest {
|
unittest {
|
||||||
// Test register concrete type
|
// Test register concrete type
|
||||||
auto registration = Container.register!(TestClass)();
|
auto registration = Container.register!(TestClass)();
|
||||||
assert(registration.registratedType == typeid(TestClass), "Type of registered type not the same");
|
assert(registration.registeredType == typeid(TestClass), "Type of registered type not the same");
|
||||||
}
|
}
|
||||||
|
|
||||||
unittest {
|
unittest {
|
||||||
|
|
Loading…
Reference in a new issue