コード例 #1
0
ファイル: TypeMapTest.cs プロジェクト: startere/p4api.net
        public void TypeMapConstructorTest()
        {
            FileType     ft      = new FileType("binary");
            TypeMapEntry mapping = new TypeMapEntry(ft, "//depot/main/...");
            FormSpec     spec    = null;
            TypeMap      target  = new TypeMap(mapping, spec);

            Assert.IsNotNull(target);
            Assert.AreEqual(target.Mapping.FileType.BaseType, BaseFileType.Binary);
            Assert.AreEqual(target.Mapping.Path, "//depot/main/...");
        }
コード例 #2
0
        public void MaxwordsTest()
        {
            List <SpecField>            fields   = null; // TODO: Initialize to an appropriate value
            Dictionary <string, string> fieldmap = null;
            List <string> words   = null;                // TODO: Initialize to an appropriate value
            List <string> formats = null;                // TODO: Initialize to an appropriate value
            Dictionary <string, string> values  = null;  // TODO: Initialize to an appropriate value
            Dictionary <string, string> presets = null;  // TODO: Initialize to an appropriate value
            List <string> openable  = null;
            List <string> maxwords  = new List <string>();
            string        maxwords1 = "100";
            string        comments  = string.Empty;                                                                                  // TODO: Initialize to an appropriate value
            FormSpec      target    = new FormSpec(fields, fieldmap, words, formats, values, presets, openable, maxwords, comments); // TODO: Initialize to an appropriate value

            target.Maxwords.Add(maxwords1);
            Assert.AreEqual(maxwords1, target.Maxwords[0]);
        }
コード例 #3
0
        public void CommentsTest()
        {
            List <SpecField>            fields   = null;                                                   // TODO: Initialize to an appropriate value
            Dictionary <string, string> fieldmap = null;
            List <string> words   = null;                                                                  // TODO: Initialize to an appropriate value
            List <string> formats = null;                                                                  // TODO: Initialize to an appropriate value
            Dictionary <string, string> values  = null;                                                    // TODO: Initialize to an appropriate value
            Dictionary <string, string> presets = null;                                                    // TODO: Initialize to an appropriate value
            string   comments = "here is a comment";
            FormSpec target   = new FormSpec(fields, fieldmap, words, formats, values, presets, comments); // TODO: Initialize to an appropriate value
            string   expected = comments;
            string   actual;

            target.Comments = expected;
            actual          = target.Comments;
            Assert.AreEqual(expected, actual);
        }
コード例 #4
0
        public void WordsTest()
        {
            List <SpecField>            fields   = null; // TODO: Initialize to an appropriate value
            Dictionary <string, string> fieldmap = null;
            List <string> words   = new List <string>();
            string        Word1   = "View 2";
            string        Word2   = "View 4";
            List <string> formats = null;                                                                  // TODO: Initialize to an appropriate value
            Dictionary <string, string> values  = null;                                                    // TODO: Initialize to an appropriate value
            Dictionary <string, string> presets = null;                                                    // TODO: Initialize to an appropriate value
            string   comments = string.Empty;                                                              // TODO: Initialize to an appropriate value
            FormSpec target   = new FormSpec(fields, fieldmap, words, formats, values, presets, comments); // TODO: Initialize to an appropriate value

            target.Words.Add(Word1);
            target.Words.Add(Word2);
            Assert.AreEqual(Word1, target.Words[0]);
            Assert.AreEqual(Word2, target.Words[1]);
        }
コード例 #5
0
        public void EmailAddressTest()
        {
            string        id           = string.Empty;                                                                                    // TODO: Initialize to an appropriate value
            string        fullname     = string.Empty;                                                                                    // TODO: Initialize to an appropriate value
            string        password     = string.Empty;                                                                                    // TODO: Initialize to an appropriate value
            string        emailaddress = "*****@*****.**";
            DateTime      updated      = new DateTime();                                                                                  // TODO: Initialize to an appropriate value
            DateTime      accessed     = new DateTime();                                                                                  // TODO: Initialize to an appropriate value
            string        jobview      = string.Empty;                                                                                    // TODO: Initialize to an appropriate value
            List <string> reviews      = null;                                                                                            // TODO: Initialize to an appropriate value
            UserType      type         = new UserType();                                                                                  // TODO: Initialize to an appropriate value
            FormSpec      spec         = null;                                                                                            // TODO: Initialize to an appropriate value
            User          target       = new User(id, fullname, password, emailaddress, updated, accessed, jobview, reviews, type, spec); // TODO: Initialize to an appropriate value
            string        expected     = "*****@*****.**";
            string        actual       = target.EmailAddress;

            Assert.AreEqual(expected, actual);
        }
コード例 #6
0
        public void TypeTest()
        {
            string        id           = string.Empty;                                                                                    // TODO: Initialize to an appropriate value
            string        fullname     = string.Empty;                                                                                    // TODO: Initialize to an appropriate value
            string        password     = string.Empty;                                                                                    // TODO: Initialize to an appropriate value
            string        emailaddress = string.Empty;                                                                                    // TODO: Initialize to an appropriate value
            DateTime      updated      = new DateTime();                                                                                  // TODO: Initialize to an appropriate value
            DateTime      accessed     = new DateTime();                                                                                  // TODO: Initialize to an appropriate value
            string        jobview      = string.Empty;                                                                                    // TODO: Initialize to an appropriate value
            List <string> reviews      = null;                                                                                            // TODO: Initialize to an appropriate value
            UserType      type         = UserType.Service;
            FormSpec      spec         = null;                                                                                            // TODO: Initialize to an appropriate value
            User          target       = new User(id, fullname, password, emailaddress, updated, accessed, jobview, reviews, type, spec); // TODO: Initialize to an appropriate value
            UserType      expected     = UserType.Service;
            UserType      actual       = target.Type;

            Assert.AreEqual(expected, actual);
        }
コード例 #7
0
        public void JobViewTest()
        {
            string        id           = string.Empty;                                                                                    // TODO: Initialize to an appropriate value
            string        fullname     = string.Empty;                                                                                    // TODO: Initialize to an appropriate value
            string        password     = string.Empty;                                                                                    // TODO: Initialize to an appropriate value
            string        emailaddress = string.Empty;                                                                                    // TODO: Initialize to an appropriate value
            DateTime      updated      = new DateTime();                                                                                  // TODO: Initialize to an appropriate value
            DateTime      accessed     = new DateTime();                                                                                  // TODO: Initialize to an appropriate value
            string        jobview      = "status=open type=bug";
            List <string> reviews      = null;                                                                                            // TODO: Initialize to an appropriate value
            UserType      type         = new UserType();                                                                                  // TODO: Initialize to an appropriate value
            FormSpec      spec         = null;                                                                                            // TODO: Initialize to an appropriate value
            User          target       = new User(id, fullname, password, emailaddress, updated, accessed, jobview, reviews, type, spec); // TODO: Initialize to an appropriate value
            string        expected     = "status=open type=bug";
            string        actual       = target.JobView;

            Assert.AreEqual(expected, actual);
        }
コード例 #8
0
        public void FieldsTest()
        {
            List <SpecField>            fields   = new List <SpecField>();
            Dictionary <string, string> fieldmap = null;
            SpecField     Field1  = new SpecField(116, "field1", SpecFieldDataType.Date, 10, SpecFieldFieldType.Key);
            SpecField     Field2  = new SpecField(118, "field2", SpecFieldDataType.Word, 64, SpecFieldFieldType.Optional);
            List <string> words   = null;                                                                                    // TODO: Initialize to an appropriate value
            List <string> formats = null;                                                                                    // TODO: Initialize to an appropriate value
            Dictionary <string, string> values  = null;                                                                      // TODO: Initialize to an appropriate value
            Dictionary <string, string> presets = null;                                                                      // TODO: Initialize to an appropriate value
            string           comments           = string.Empty;                                                              // TODO: Initialize to an appropriate value
            FormSpec         target             = new FormSpec(fields, fieldmap, words, formats, values, presets, comments); // TODO: Initialize to an appropriate value
            List <SpecField> expected           = fields;

            target.Fields.Add(Field1);
            target.Fields.Add(Field2);
            Assert.AreEqual(Field1, target.Fields[0]);
            Assert.AreEqual(Field2, target.Fields[1]);
        }
コード例 #9
0
        public void ValuesTest()
        {
            List <SpecField>            fields   = null; // TODO: Initialize to an appropriate value
            Dictionary <string, string> fieldmap = null;
            List <string> words   = null;                // TODO: Initialize to an appropriate value
            List <string> formats = null;                // TODO: Initialize to an appropriate value
            Dictionary <string, string> values = new Dictionary <string, string>();

            values.Add("Severity", "A/B/C");
            Dictionary <string, string> presets = null;                                                    // TODO: Initialize to an appropriate value
            string   comments = string.Empty;                                                              // TODO: Initialize to an appropriate value
            FormSpec target   = new FormSpec(fields, fieldmap, words, formats, values, presets, comments); // TODO: Initialize to an appropriate value
            Dictionary <string, string> expected = values;                                                 // TODO: Initialize to an appropriate value
            Dictionary <string, string> actual;

            target.Values = expected;
            actual        = target.Values;
            Assert.AreEqual(expected, actual);
        }
コード例 #10
0
        public void FormatsTest()
        {
            List <SpecField>            fields   = null; // TODO: Initialize to an appropriate value
            Dictionary <string, string> fieldmap = null;
            List <string> words   = null;                // TODO: Initialize to an appropriate value
            List <string> formats = new List <string>();
            string        Format1 = "Change 1 L";
            string        Format2 = "Date 3 R";
            Dictionary <string, string> values  = null;                                                         // TODO: Initialize to an appropriate value
            Dictionary <string, string> presets = null;                                                         // TODO: Initialize to an appropriate value
            string        comments = string.Empty;                                                              // TODO: Initialize to an appropriate value
            FormSpec      target   = new FormSpec(fields, fieldmap, words, formats, values, presets, comments); // TODO: Initialize to an appropriate value
            List <string> expected = formats;

            target.Formats.Add(Format1);
            target.Formats.Add(Format2);
            Assert.AreEqual(Format1, target.Formats[0]);
            Assert.AreEqual(Format2, target.Formats[1]);
        }
コード例 #11
0
        public void PresetsTest()
        {
            List <SpecField>            fields   = null; // TODO: Initialize to an appropriate value
            Dictionary <string, string> fieldmap = null;
            List <string> words   = null;                // TODO: Initialize to an appropriate value
            List <string> formats = null;                // TODO: Initialize to an appropriate value
            Dictionary <string, string> values  = null;  // TODO: Initialize to an appropriate value
            Dictionary <string, string> presets = new Dictionary <string, string>();

            presets.Add("Status", "open");
            List <string> openable = null;
            List <string> maxwords = null;
            string        comments = string.Empty;                                                                                  // TODO: Initialize to an appropriate value
            FormSpec      target   = new FormSpec(fields, fieldmap, words, formats, values, presets, openable, maxwords, comments); // TODO: Initialize to an appropriate value
            Dictionary <string, string> expected = presets;                                                                         // TODO: Initialize to an appropriate value
            Dictionary <string, string> actual;

            target.Presets = expected;
            actual         = target.Presets;
            Assert.AreEqual(expected, actual);
        }