Exemplo n.º 1
0
        public void AddDogTest()
        {
            var dog = new DogBuilder().Roxy().Build();

            var adapter = new DogAdapterStub();
            var newDog = adapter.AddDog(dog);

            Assert.AreEqual(dog.Name, newDog.Name);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds the dog.
        /// </summary>
        /// <param name="dog">The dog.</param>
        /// <returns>The dog</returns>
        public ResponseItem<Dog> AddDog(Dog dog)
        {
            var adapter = new DogAdapterStub();
            var newDog = adapter.AddDog(dog);

            var result = (newDog != null) ? ResultCodeEnum.Success : ResultCodeEnum.NotFound;

            return new ResponseItem<Dog>(result)
            {
                Data = newDog
            };
        }