예제 #1
0
        public void AssertValid_Valid()
        {
            string projFile = GetXmlProjectFilename("monkey");

            m_mockFileOs.AddExistingFile(projFile);

            var proj = new ProjectId(DirectoryFinder.GetXmlDataFileName("monkey"), null);

            proj.AssertValid();             // no exception should be thrown here for a valid project.
        }
예제 #2
0
        public void AssertValid_Invalid_SharedFolderNotFound()
        {
            var proj = new ProjectId(DirectoryFinder.GetDb4oDataFileName("monkey"), FwLinkArgs.kLocalHost);

            try
            {
                proj.AssertValid();
                Assert.Fail("FwStartupException expected");
            }
            catch (FwStartupException exception)
            {
                Assert.IsTrue(exception.ReportToUser);
            }
        }
예제 #3
0
        public void AssertValid_InvalidProjectType()
        {
            var proj = new ProjectId(FDOBackendProviderType.kInvalid, DirectoryFinder.GetXmlDataFileName("invalid"), null);

            try
            {
                proj.AssertValid();
                Assert.Fail("FwStartupException expected");
            }
            catch (FwStartupException exception)
            {
                Assert.IsTrue(exception.ReportToUser);
            }
        }
예제 #4
0
        public void AssertValid_Invalid_FileNotFound()
        {
            var proj = new ProjectId(DirectoryFinder.GetXmlDataFileName("notfound"), null);

            try
            {
                proj.AssertValid();
                Assert.Fail("FwStartupException expected");
            }
            catch (FwStartupException exception)
            {
                Assert.IsTrue(exception.ReportToUser);
            }
        }
예제 #5
0
        public void AssertValid_Invalid_NoName()
        {
            var proj = new ProjectId(string.Empty, null);

            try
            {
                proj.AssertValid();
                Assert.Fail("FwStartupException expected");
            }
            catch (FwStartupException exception)
            {
                Assert.IsFalse(exception.ReportToUser);
            }
        }
예제 #6
0
        public void CheckProperties()
        {
            string expectedProjectDir = Path.Combine(DirectoryFinder.ProjectsDirectory, "SomeTest");

            m_mockFileOs.ExistingDirectories.Add(expectedProjectDir);

            const string type     = "db4ocs";
            const string host     = "127.0.0.1";
            string       filename = DirectoryFinder.GetDb4oDataFileName("SomeTest");

            var proj = new ProjectId(type, filename, host);

            proj.AssertValid();
            Assert.AreEqual(Path.Combine(expectedProjectDir, filename), proj.Path);

            proj = new ProjectId(filename, host);
            proj.AssertValid();
            Assert.AreEqual(Path.Combine(expectedProjectDir, filename), proj.Path);
        }
예제 #7
0
		public void CheckProperties()
		{
			string expectedProjectDir = Path.Combine(FwDirectoryFinder.ProjectsDirectory, "SomeTest");
			m_mockFileOs.ExistingDirectories.Add(expectedProjectDir);

			const string type = "db4ocs";
			const string host = "127.0.0.1";
			string filename = FdoFileHelper.GetDb4oDataFileName("SomeTest");

			var proj = new ProjectId(type, filename, host);
			proj.AssertValid();
			Assert.AreEqual(Path.Combine(expectedProjectDir, filename), proj.Path);

			proj = new ProjectId(filename, host);
			proj.AssertValid();
			Assert.AreEqual(Path.Combine(expectedProjectDir, filename), proj.Path);
		}
예제 #8
0
		public void AssertValid_Invalid_SharedFolderNotFound()
		{
			var proj = new ProjectId(FdoFileHelper.GetDb4oDataFileName("monkey"), FwLinkArgs.kLocalHost);
			try
			{
				proj.AssertValid();
				Assert.Fail("FwStartupException expected");
			}
			catch (StartupException exception)
			{
				Assert.IsTrue(exception.ReportToUser);
			}
		}
예제 #9
0
		public void AssertValid_InvalidProjectType()
		{
			var proj = new ProjectId(FDOBackendProviderType.kInvalid, FdoFileHelper.GetXmlDataFileName("invalid"), null);
			try
			{
				proj.AssertValid();
				Assert.Fail("FwStartupException expected");
			}
			catch (StartupException exception)
			{
				Assert.IsTrue(exception.ReportToUser);
			}
		}
예제 #10
0
		public void AssertValid_Invalid_FileNotFound()
		{
			var proj = new ProjectId(FdoFileHelper.GetXmlDataFileName("notfound"), null);
			try
			{
				proj.AssertValid();
				Assert.Fail("FwStartupException expected");
			}
			catch (StartupException exception)
			{
				Assert.IsTrue(exception.ReportToUser);
			}
		}
예제 #11
0
		public void AssertValid_Invalid_NoName()
		{
			var proj = new ProjectId(string.Empty, null);
			try
			{
				proj.AssertValid();
				Assert.Fail("FwStartupException expected");
			}
			catch (StartupException exception)
			{
				Assert.IsFalse(exception.ReportToUser);
			}
		}
예제 #12
0
		public void AssertValid_Valid()
		{
			string projFile = GetXmlProjectFilename("monkey");
			m_mockFileOs.AddExistingFile(projFile);

			var proj = new ProjectId(FdoFileHelper.GetXmlDataFileName("monkey"), null);
			proj.AssertValid(); // no exception should be thrown here for a valid project.
		}