static void Configure(LucIocContainer container) { container.Register <IMamifero, Mamifero>(); container.Register <IPerro, Perro>(); container.Register <IGato, Gato>(); container.Register <ITigre, Tigre>(); container.Register <ISalvaje, Salvaje>(); }
public static LucIocContainer Configure(this LucIocContainer container) { container.Register <IMamifero, Mamifero>(); container.Register <IPerro, Perro>(); container.Register <IGato, Gato>(); container.Register <ITigre, Tigre>(); return(container); }
static void Main(string[] args) { try { LucIocContainer container = new LucIocContainer(); Configure(container); Console.WriteLine(((IAnimal)container.Resolve <IPerro>()).ObtenerEspecie()); Console.WriteLine(((IAnimal)container.Resolve <IGato>()).ObtenerEspecie()); Console.WriteLine(((IAnimal)container.Resolve <ITigre>()).ObtenerEspecie()); } catch (Exception ex) { Console.Write(string.Format("Ocurrio un error: {0}", ex.Message)); } Console.ReadKey(); }
public void SetUp() { _container = LucIocContainer.GetNewContainer(); _container.Register <ITest, Test.Test>(); }