public string Adopt(string userName, DogBreedEnum raceEnum) { string validationMessage = ""; if (!this.Dogs.Any(x => x.Race == raceEnum)) { validationMessage = "We dont have the dog you want"; } else if (userName.Contains("Dog killer")) { validationMessage = "I will call Police"; } if (!string.IsNullOrEmpty(validationMessage)) { //something went wrong whit this user return(validationMessage); } var dog = this.Dogs.FirstOrDefault(x => x.Race == raceEnum); var price = this.Calculate2(dog); var ticket = "------------------------------------------------------------------------------------" + Environment.NewLine; ticket += string.Format("Dear {0} this is the ticket conforming you are Adopting a dog to us.", userName) + Environment.NewLine; ticket += string.Format("The dog its {0}", dog.Desc()) + Environment.NewLine; ticket += string.Format("You must pay: {0} on the cash register", price) + Environment.NewLine; ticket += "------------------------------------------------------------------------------------" + Environment.NewLine; return(ticket); }
public IDog CreateDog(DogBreedEnum dogBreed) { if (dogBreed == DogBreedEnum.Greyhound) { return(ContainerConfig.GetInstance <IDog>()); } return(null); }
public IDog CreateDog(DogBreedEnum dogBreed) { IDog dog = new Dog(); return(dog); }
public IDog CreateDog(DogBreedEnum dogBreedEnum) { IDog newDog = _dogFactory.CreateDog(dogBreedEnum); return(ProvidePropertiesToDog(newDog)); }
public DogBuilder WithBreed(DogBreedEnum race) { this.race = race; return(this); }