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

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

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

            Assert.IsTrue(result);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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)));
        }
Ejemplo n.º 6
0
        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)));
        }
Ejemplo n.º 7
0
        public void User_And_Password_Are_Valid()
        {
            TenderApi.TenderApi tapi = new TenderApi.TenderApi(_site, _email, _password);
            bool result = tapi.AuthenticationIsValid();

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

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

            Assert.IsFalse(result);
        }
Ejemplo n.º 10
0
        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);
        }