コード例 #1
0
        public void AddEmptyRecord()
        {
            TestManager         testManager         = CreateTestManager();
            NameValueCollection nameValueCollection = new NameValueCollection();
            string output = testManager.AddRecord(nameValueCollection, _testIp);

            Assert.IsNull(output);
        }
コード例 #2
0
        public void AddRecordWithNoAnswers()
        {
            TestManager         testManager         = CreateTestManager();
            NameValueCollection nameValueCollection = new NameValueCollection();

            nameValueCollection.Add("name", "testName");
            nameValueCollection.Add("surname", "testSurname");
            nameValueCollection.Add("group", "1");
            string output = testManager.AddRecord(nameValueCollection, _testIp);

            Assert.IsNull(output);
        }
コード例 #3
0
        public void AddRecordWithInvalidGroup()
        {
            TestManager         testManager         = CreateTestManager();
            NameValueCollection nameValueCollection = new NameValueCollection();

            nameValueCollection.Add("name", "testName");
            nameValueCollection.Add("surname", "testSurname");
            nameValueCollection.Add("group", "20");
            nameValueCollection.Add("q1", "a1");
            nameValueCollection.Add("q2", "a2");
            nameValueCollection.Add("q3", "a3");
            string output = testManager.AddRecord(nameValueCollection, _testIp);

            Assert.IsNotNull(output);
        }
コード例 #4
0
        public void AddValidRecordWithNotExistingAnswers()
        {
            TestManager         testManager         = CreateTestManager();
            NameValueCollection nameValueCollection = new NameValueCollection();

            nameValueCollection.Add("name", "testName");
            nameValueCollection.Add("surname", "testSurname");
            nameValueCollection.Add("group", "1");
            nameValueCollection.Add("q1", "customAnswer");
            nameValueCollection.Add("q2", "customAnswer");
            nameValueCollection.Add("q3", "customAnswer");
            string output = testManager.AddRecord(nameValueCollection, _testIp);

            Assert.IsNotNull(output);
            Assert.IsTrue(output.Contains("0/3"));
        }