public void Get_Wishes() { this.database = MockRepository.GenerateMock<IDatabaseAccessLayer>(); var serivce = new WunschzettelService(this.database); const int personId = 0; serivce.GetWishes(0); database.AssertWasCalled(s => s.GetWishes(Arg<int>.Is.Equal(personId))); }
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))); }
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))); }
public Runner(string ip, int port) { TypeIdGenerator.getTowerType(0); // db does nox exist. Do not worry about the ID and password :) dal = new MySQLDatabaseAccessor("127.0.0.1", 3306, "sciencewarsdb", "root", "admin"); ResourceLoader.loadResources(); queue = new BasicPlayerQueue(this, 2); server.clientArrivedEvent += server_clientArrivedEvent; server.clientRemovedEvent += server_clientRemovedEvent; server.messageArrivedEvent += server_messageArrivedEvent; server.StartServer(ip, port); }
public Runner(string ip, int port) { TypeIdGenerator.getTowerType(0); // db does nox exist. Do not worry about the ID and password :) dal = new MySQLDatabaseAccessor("127.0.0.1", 3306, "sciencewarsdb", "root", "admin"); ResourceLoader.loadResources(); queue = new BasicPlayerQueue(this, 2); server.clientArrivedEvent += server_clientArrivedEvent; server.clientRemovedEvent += server_clientRemovedEvent; server.messageArrivedEvent += server_messageArrivedEvent; server.StartServer(ip, port); }
public void SetUp() { this.database = MockRepository.GenerateStub<IDatabaseAccessLayer>(); this.database.Stub(s => s.GetPerson(Arg<int>.Is.Equal(1))).Return(new Person { Id = 1 }); this.database.Stub(s => s.Login(Arg<LoginData>.Is.Equal(new LoginData("Login","Login")))).Return(new User("Login", "Login")); this.service = MockRepository.GenerateStub<IWunschzettelService>(); this.service.Stub(s => s.GetPerson(Arg<int>.Is.Equal(1))).Return(new Person { Id = 1 }); this.serializer = MockRepository.GenerateStub<WunschzettelSerializer>(); this.server = new Server(this.database); server.Run(); }
public LoginManager(Runner runner, Session session, IDatabaseAccessLayer dal) { this.runner = runner; this.session = session; this.dal = dal; }
private void CreateDatabase() { var builder = new SessionFactoryBuilder(); this.database = new DatabaseAccessLayer(builder); this.database.Initalize(Schema.Rebuild); }
public LoginManager(Runner runner, Session session, IDatabaseAccessLayer dal) { this.runner = runner; this.session = session; this.dal = dal; }
public Server(IDatabaseAccessLayer database) { this.database = database; }
public void SetUp() { this.database = MockRepository.GenerateStub<IDatabaseAccessLayer>(); }
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))); }
public WunschzettelService(IDatabaseAccessLayer database) { this.database = database; }