Ejemplo n.º 1
0
        public void AddPlaceholderDataWithPossibleTombstoneFolder()
        {
            PlaceholderTable.PlaceholderData placeholderData = new PlaceholderTable.PlaceholderData()
            {
                Path     = DefaultPath,
                PathType = PlaceholderTable.PlaceholderData.PlaceholderType.PossibleTombstoneFolder,
                Sha      = null
            };

            this.TestPlaceholdersInsert(
                placeholders => placeholders.AddPlaceholderData(placeholderData),
                DefaultPath,
                PathTypePossibleTombstoneFolder,
                sha: null);
        }
Ejemplo n.º 2
0
        public void AddPlaceholderDataWithExpandedFolder()
        {
            PlaceholderTable.PlaceholderData placeholderData = new PlaceholderTable.PlaceholderData()
            {
                Path     = DefaultPath,
                PathType = PlaceholderTable.PlaceholderData.PlaceholderType.ExpandedFolder,
                Sha      = null
            };

            this.TestPlaceholdersInsert(
                placeholders => placeholders.AddPlaceholderData(placeholderData),
                DefaultPath,
                PathTypeExpandedFolder,
                sha: null);
        }
Ejemplo n.º 3
0
        public void AddPlaceholderDataWithFile()
        {
            PlaceholderTable.PlaceholderData placeholderData = new PlaceholderTable.PlaceholderData()
            {
                Path     = DefaultPath,
                PathType = PlaceholderTable.PlaceholderData.PlaceholderType.File,
                Sha      = DefaultSha
            };

            this.TestPlaceholdersInsert(
                placeholders => placeholders.AddPlaceholderData(placeholderData),
                DefaultPath,
                PathTypeFile,
                DefaultSha);
        }
Ejemplo n.º 4
0
        public void AddFilePlaceholderDataWithNullShaThrowsException()
        {
            PlaceholderTable.PlaceholderData placeholderData = new PlaceholderTable.PlaceholderData()
            {
                Path     = DefaultPath,
                PathType = PlaceholderTable.PlaceholderData.PlaceholderType.File,
                Sha      = null
            };

            GVFSDatabaseException ex = Assert.Throws <GVFSDatabaseException>(() => this.TestPlaceholdersInsert(
                                                                                 placeholders => placeholders.AddPlaceholderData(placeholderData),
                                                                                 DefaultPath,
                                                                                 PathTypeFile,
                                                                                 sha: null,
                                                                                 throwException: true));

            ex.Message.ShouldEqual($"Invalid SHA 'null' for file {DefaultPath}");
        }
Ejemplo n.º 5
0
        public void AddPlaceholderDataThrowsGVFSDatabaseException()
        {
            PlaceholderTable.PlaceholderData placeholderData = new PlaceholderTable.PlaceholderData()
            {
                Path     = DefaultPath,
                PathType = PlaceholderTable.PlaceholderData.PlaceholderType.File,
                Sha      = DefaultSha
            };

            GVFSDatabaseException ex = Assert.Throws <GVFSDatabaseException>(() => this.TestPlaceholdersInsert(
                                                                                 placeholders => placeholders.AddPlaceholderData(placeholderData),
                                                                                 DefaultPath,
                                                                                 PathTypeFile,
                                                                                 DefaultSha,
                                                                                 throwException: true));

            ex.Message.ShouldEqual($"PlaceholderTable.Insert({DefaultPath}, {PlaceholderTable.PlaceholderData.PlaceholderType.File}, {DefaultSha}) Exception");
            ex.InnerException.Message.ShouldEqual(DefaultExceptionMessage);
        }