Esempio n. 1
0
        public async System.Threading.Tasks.Task Test_CreateInviteEmail()
        {
            IEmailHandler emailHandler = new EmailHandler(_configMock.Object, _resourcesHelper.Object, _tokenHandler.Object);

            User recievingUser = new User()
            {
                ID    = 1,
                Email = "*****@*****.**",
                Name  = "test1"
            };

            User sendingUser = new User()
            {
                ID    = 2,
                Email = "*****@*****.**",
                Name  = "test2"
            };

            Group group = new Group()
            {
                ID   = 1,
                Name = "Group1"
            };

            EmailDTO result = emailHandler.CreateInviteEmail(recievingUser, sendingUser, group);

            Assert.Equal(result.RecievingAdrress, recievingUser.Email);
            Assert.Equal(result.SendingAdrdress, sendingUser.Email);
            Assert.Contains(group.Name, result.Message);
            Assert.Contains(recievingUser.Name, result.Message);
        }