public void Invalid_Password_Fails()
        {
            TenderApi.TenderApi tapi = new TenderApi.TenderApi(_site, _email, "*3jfdsa#");
            bool result = tapi.AuthenticationIsValid();

            Assert.IsFalse(result);
        }
        public void Invalid_Api_Fails()
        {
            TenderApi.TenderApi tapi = new TenderApi.TenderApi(_site, "ifthisworkssomethingiswrong");
            bool result = tapi.AuthenticationIsValid();

            Assert.IsFalse(result);
        }
        public void User_And_Password_Are_Valid()
        {
            TenderApi.TenderApi tapi = new TenderApi.TenderApi(_site, _email, _password);
            bool result = tapi.AuthenticationIsValid();

            Assert.IsTrue(result);
        }
        public void Can_Create_SSO_User()
        {
            string expectedEmail = Guid.NewGuid().ToString() + "@test.com";

            _testApi = new TenderApi.TenderApi(_site, _userName, _password);

            _testApi.CreateUser(expectedEmail, _site, _ssoKey);

            // SSO CreateUser returns user entity but it doesn't contain email
            User u = _testApi.FindUser(expectedEmail);

            Assert.NotNull(u);
            Assert.AreEqual(expectedEmail, u.email);
        }
        public void Can_Create_Comment()
        {
            List <Discussion> ds = _testApi.GetDiscussions();
            int    dID           = ds.First().GetDiscussionID();
            string commentGuid   = Guid.NewGuid().ToString();

            _testApi = new TenderApi.TenderApi(_site, _userName, _password);

            Comment createdComment = _testApi.AddComment(dID, new Comment
            {
                body = "This is a comment: Greetings from TenderApi tests. " + commentGuid,
            });

            List <Comment> cs = _testApi.GetComments(dID);

            Assert.IsTrue(cs.Any(c => c.body.Contains(commentGuid)));
        }
        public void Can_Create_Comment()
        {
            List<Discussion> ds = _testApi.GetDiscussions();
            int dID = ds.First().GetDiscussionID();
            string commentGuid = Guid.NewGuid().ToString();

            _testApi = new TenderApi.TenderApi(_site, _userName, _password);

            Comment createdComment = _testApi.AddComment(dID, new Comment
            {
                body = "This is a comment: Greetings from TenderApi tests. " + commentGuid,
            });

            List<Comment> cs = _testApi.GetComments(dID);

            Assert.IsTrue(cs.Any(c => c.body.Contains(commentGuid)));
        }
        public void User_And_Password_Are_Valid()
        {
            TenderApi.TenderApi tapi = new TenderApi.TenderApi(_site, _email, _password);
            bool result = tapi.AuthenticationIsValid();

            Assert.IsTrue(result);
        }
        public void Invalid_Password_Fails()
        {
            TenderApi.TenderApi tapi = new TenderApi.TenderApi(_site, _email, "*3jfdsa#");
            bool result = tapi.AuthenticationIsValid();

            Assert.IsFalse(result);
        }
        public void Invalid_Api_Fails()
        {
            TenderApi.TenderApi tapi = new TenderApi.TenderApi(_site, "ifthisworkssomethingiswrong");
            bool result = tapi.AuthenticationIsValid();

            Assert.IsFalse(result);
        }
        public void Can_Create_SSO_User()
        {
            string expectedEmail = Guid.NewGuid().ToString() + "@test.com";
            _testApi = new TenderApi.TenderApi(_site, _userName, _password);

            _testApi.CreateUser(expectedEmail, _site, _ssoKey);

            // SSO CreateUser returns user entity but it doesn't contain email
            User u = _testApi.FindUser(expectedEmail);

            Assert.NotNull(u);
            Assert.AreEqual(expectedEmail, u.email);
        }