public static IAminal Create(Aminal aminal) { switch (aminal) { case Aminal.Dog: return(new Dog()); case Aminal.Cat: return(new Cat()); default: return(null); } }
public string WhenFactoyUseDifferentAminalWillReturnDifferentSound(Aminal aminal) { var factory = Factory.Create(aminal); return(factory.Sound()); }