Ejemplo n.º 1
0
        public void Add_Wishes()
        {
            this.database = MockRepository.GenerateMock<IDatabaseAccessLayer>();

            var serivce = new WunschzettelService(this.database);

            var wishes = new [] { new Wish(), new Wish()};

            serivce.AddWishes(wishes);

            database.AssertWasCalled(s => s.AddWishes(Arg<IEnumerable<Wish>>.Is.Equal(wishes)));
        }
Ejemplo n.º 2
0
        public void Get_Wish()
        {
            this.database = MockRepository.GenerateMock<IDatabaseAccessLayer>();

            var serivce = new WunschzettelService(this.database);

            const int id = 0;

            serivce.GetWish(0);

            database.AssertWasCalled(s => s.GetWish(Arg<int>.Is.Equal(id)));
        }
Ejemplo n.º 3
0
        public void Add_Wish()
        {
            this.database = MockRepository.GenerateMock<IDatabaseAccessLayer>();

            var serivce = new WunschzettelService(this.database);

            var wish = new Wish();

            serivce.AddWish(wish);

            database.AssertWasCalled(s => s.AddWish(Arg<Wish>.Is.Equal(wish)));
        }
Ejemplo n.º 4
0
        public void Save_Person()
        {
            this.database = MockRepository.GenerateMock<IDatabaseAccessLayer>();

            var serivce = new WunschzettelService(this.database);

            var person = new Person();

            serivce.SavePerson(person);

            database.AssertWasCalled(s => s.SavePerson(Arg<Person>.Is.Equal(person)));
        }