コード例 #1
0
        public void AddTest1()
        {
            ViewMap target = new ViewMap();

            MapEntry Entry0 = new MapEntry(MapType.Include,
                                           new DepotPath("//depot/main/p4/..."),
                                           new ClientPath("//user_win-user/main/p4/..."));
            MapEntry Entry1 = new MapEntry(MapType.Exclude,
                                           new DepotPath("//usr/..."),
                                           new ClientPath("//user_win-user/usr/..."));
            MapEntry Entry2 = new MapEntry(MapType.Overlay,
                                           new DepotPath("//spec/..."),
                                           new ClientPath("//user_win-user/spec/..."));

            target.Add("	//depot/main/p4/... //user_win-user/main/p4/...");
            target.Add("-//usr/... //user_win-user/usr/...");
            target.Add("+//spec/... //user_win-user/spec/...");

            Assert.AreEqual(Entry0.Type, target[0].Type);
            Assert.AreEqual(Entry0.Right.Path, target[0].Right.Path);
            Assert.AreEqual(Entry0.Left.Path, target[0].Left.Path);

            Assert.AreEqual(Entry1.Type, target[1].Type);
            Assert.AreEqual(Entry1.Right.Path, target[1].Right.Path);
            Assert.AreEqual(Entry1.Left.Path, target[1].Left.Path);

            Assert.AreEqual(Entry2.Type, target[2].Type);
            Assert.AreEqual(Entry2.Right.Path, target[2].Right.Path);
            Assert.AreEqual(Entry2.Left.Path, target[2].Left.Path);
        }
コード例 #2
0
ファイル: LabelTest.cs プロジェクト: startere/p4api.net
        static Label setTarget()
        {
            ViewMap  viewmap = new ViewMap();
            MapEntry m       = new MapEntry(MapType.Include, new DepotPath("//depot/main/... "), null);
            MapEntry m1      = new MapEntry(MapType.Include, new DepotPath("//depot/rel1/... "), null);
            MapEntry m2      = new MapEntry(MapType.Include, new DepotPath("//depot/dev/... "), null);

            viewmap.Add(m);
            viewmap.Add(m1);
            viewmap.Add(m2);
            DateTime updated  = new DateTime(2011, 03, 21);
            DateTime accessed = new DateTime(2011, 03, 21);
            Label    target   = new Label(
                id, owner, updated, accessed, description, locked, revision, serverId, viewmap, spec, options);

            return(target);
        }
コード例 #3
0
ファイル: StreamTest.cs プロジェクト: startere/p4api.net
 static void setTarget()
 {
     paths = new ViewMap();
     paths.Add(path);
     remapped = new ViewMap();
     remapped.Add(remap);
     ignored = new ViewMap();
     ignored.Add(ig);
     target = new Stream(id, updated, accessed,
                         ownername, name, parent, baseparent, type, description,
                         options, firmerthanparent, changeflowstoparent,
                         changeflowsfromparent, paths, remapped, ignored, view, spec);
 }
コード例 #4
0
ファイル: LabelTest.cs プロジェクト: startere/p4api.net
        public void ViewMapTest()
        {
            ViewMap  expected = new ViewMap();
            MapEntry m        = new MapEntry(MapType.Include, new DepotPath("//depot/main/..."), null);

            expected.Add(m);
            Label target = setTarget();

            setTarget();
            Assert.AreEqual(target.ViewMap[1].Left.Path, "//depot/rel1/... ");
            target.ViewMap = expected;
            ViewMap actual = target.ViewMap;

            Assert.AreEqual(expected, actual);
        }