Exemplo n.º 1
0
 void CreateDTE()
 {
     fakeProjectService = new FakePackageManagementProjectService();
     fakeProjectService.OpenSolution = new SD.Solution(new SD.MockProjectChangeWatcher());
     fakeFileService = new FakeFileService(null);
     dte             = new DTE(fakeProjectService, fakeFileService);
 }
Exemplo n.º 2
0
 void CreateProjectItems()
 {
     project         = new TestableDTEProject();
     msbuildProject  = project.TestableProject;
     projectItems    = project.ProjectItems;
     fakeFileService = project.FakeFileService;
 }
        public void GetFileAsync_AnyUri_GetException()
        {
            IRandomGenerator randomGeneratorStub = new AlwaysGenerateZero();
            IFileService     fileService         = new FakeFileService(randomGeneratorStub);

            Assert.ThrowsAsync <Exception>(async() => await fileService.GetFileAsync("1"));
        }
Exemplo n.º 4
0
 void CreateDTE()
 {
     fakeProjectService = new FakePackageManagementProjectService();
     OpenSolution(@"d:\projects\MyProject\MyProject.sln");
     fakeFileService = new FakeFileService(null);
     dte             = new DTE(fakeProjectService, fakeFileService);
 }
 void CreateItemOperations()
 {
     fakeProjectService = new FakePackageManagementProjectService();
     fakeFileService    = new FakeFileService(null);
     dte            = new DTE(fakeProjectService, fakeFileService);
     itemOperations = dte.ItemOperations;
 }
Exemplo n.º 6
0
        public void Test_interaction_ReportViverAndFakelass()
        {
            FakeFileService moq_fakeFile = new FakeFileService();
            ReportViwer     viwer        = new ReportViwer(moq_fakeFile);

            viwer.PrepareDate(@"D:\Laboratory_works\Тестирование\File_test");
            Assert.IsTrue(moq_fakeFile.Check_FakeFileService);
        }
Exemplo n.º 7
0
 void CreateProjectItems(string fileName = @"d:\projects\MyProject\MyProject.csproj")
 {
     project                 = new TestableDTEProject();
     msbuildProject          = project.TestableProject;
     msbuildProject.FileName = new FileName(fileName);
     projectItems            = (ProjectItems)project.ProjectItems;
     fakeFileService         = project.FakeFileService;
 }
Exemplo n.º 8
0
 void CreateDTE(string fileName = @"d:\projects\MyProject\MyProject.sln")
 {
     ICSharpCode.SharpDevelop.SD.InitializeForUnitTests();
     fakeProjectService = new FakePackageManagementProjectService();
     OpenSolution(fileName);
     fakeFileService = new FakeFileService(null);
     dte             = new DTE(fakeProjectService, fakeFileService);
 }
        public async Task GetFileAsync_AnyUri_GetFile()
        {
            IRandomGenerator randomGeneratorStub = new AlwaysGenerateOne();
            IFileService     fileService         = new FakeFileService(randomGeneratorStub);
            var file = await fileService.GetFileAsync("1");

            Assert.IsTrue(file.Content.Length > 0);
            Assert.IsTrue(file.FileName.EndsWith("bin"));
        }
        public void TestRemoveTemporaryFilesGetCalled()
        {
            var stub         = new FakeFileService();
            var reportViewer = new ReportViewer(stub);

            reportViewer.Clean("E:");

            Assert.That(stub.IsCalled, Is.EqualTo(true));
        }
Exemplo n.º 11
0
 void CreateProjectWithOneFileInProjectFolder(
     string include,
     string projectFileName = @"c:\projects\MyProject\MyProject.csproj")
 {
     project                 = new TestableDTEProject();
     msbuildProject          = project.TestableProject;
     fakeFileService         = project.FakeFileService;
     msbuildProject.FileName = new FileName(projectFileName);
     msbuildProject.AddFile(include);
 }
        void CreateProjectWithOneFile(string fileName)
        {
            project         = new TestableDTEProject();
            msbuildProject  = project.TestableProject;
            fakeFileService = project.FakeFileService;

            fileProjectItem = new FileProjectItem(msbuildProject, ItemType.Compile)
            {
                FileName = fileName
            };
        }
 IOpenPackageReadMeMonitor CreateReadMeMonitor(string packageId)
 {
     fileService = new FakeFileService(null);
     return(new OpenPackageReadMeMonitor(packageId, fakeProject, fileService));
 }
Exemplo n.º 14
0
 OpenPackageReadMeMonitor CreateMonitor(string packageId)
 {
     fileService = new FakeFileService(null);
     project     = new FakePackageManagementProject();
     return(new OpenPackageReadMeMonitor(packageId, project, fileService));
 }