Esempio n. 1
0
        public void GetExistingUser_Success()
        {
            User newUser = new User()
            {
                Id = 1, Name = "Haroon", Surname = "ANWARBAIG", Email = "*****@*****.**", Password = "******"
            };

            dal.AddUser(newUser);
            Assert.AreEqual(userController.GetUser(1), newUser);
        }
        public void CreateSession_Success()
        {
            dal.AddUser(new User());           // id = 1
            dal.AddSprydZone(new SprydZone()); // id = 1
            UserSession newSessionParameters = new UserSession()
            {
                UserId    = 1,
                SessionId = 1,
                Session   = new Session()
                {
                    SprydZoneId = 1
                }
            };

            Session newSession = sessionController.AddSession(newSessionParameters);

            Assert.AreEqual(dal.GetSessionById(1), newSession);
            Assert.AreEqual(dal.GetSessionAllUsers(newSession.Id).First().Id, 1);
        }