Exemplo n.º 1
0
        public void ODBCServer_MethodName_Scenerio_Result_oneParementer()
        {
            //------------Setup for test--------------------------
            var id  = Guid.NewGuid();
            var mod = new ODBCServerModel();
            var act = new DsfODBCDatabaseActivity
            {
                SourceId = mod.Sources[0].Id,
                Inputs   = new List <IServiceInput>()
                {
                    new ServiceInput("[[a]]", "asa")
                },
                Outputs = new List <IServiceOutputMapping> {
                    new ServiceOutputMapping("a", "b", "c"), new ServiceOutputMapping("d", "e", "f")
                },
                ServiceName = "dsfBob"
            };

            //------------Execute Test---------------------------
            var ODBCServer = new ODBCDatabaseDesignerViewModel(ModelItemUtils.CreateModelItem(act));

            //------------Assert Results-------------------------
            Assert.IsTrue(ODBCServer.SourceRegion.IsEnabled);
            Assert.IsTrue(ODBCServer.ActionRegion.IsEnabled);
            Assert.IsTrue(ODBCServer.ErrorRegion.IsEnabled);
            ODBCServer.ValidateTestComplete();
            Assert.IsTrue(ODBCServer.OutputsRegion.IsEnabled);
        }
Exemplo n.º 2
0
        public void ODBCServer_GenerateOutputsVisible()
        {
            //------------Setup for test--------------------------
            var id  = Guid.NewGuid();
            var mod = new ODBCServerModel();
            var act = new DsfODBCDatabaseActivity
            {
                SourceId = mod.Sources[0].Id,
                Inputs   = new List <IServiceInput>()
                {
                    new ServiceInput("[[a]]", "asa")
                },
                Outputs = new List <IServiceOutputMapping> {
                    new ServiceOutputMapping("a", "b", "c"), new ServiceOutputMapping("d", "e", "f")
                },
                ServiceName = "dsfBob"
            };

            //------------Execute Test---------------------------
            var ODBCServer = new ODBCDatabaseDesignerViewModel(ModelItemUtils.CreateModelItem(act), mod);

            ODBCServer.GenerateOutputsVisible = true;

            //------------Assert Results-------------------------

            Assert.IsFalse(ODBCServer.OutputsRegion.IsEnabled);
        }
Exemplo n.º 3
0
        public void ODBCServer_WorstError()
        {
            //------------Setup for test--------------------------
            var id  = Guid.NewGuid();
            var mod = new ODBCServerModel();
            var act = new DsfODBCDatabaseActivity
            {
                SourceId = mod.Sources[0].Id,
                Inputs   = new List <IServiceInput>()
                {
                    new ServiceInput("[[a]]", "asa")
                },
                Outputs = new List <IServiceOutputMapping> {
                    new ServiceOutputMapping("a", "b", "c"), new ServiceOutputMapping("d", "e", "f")
                },
                ServiceName = "dsfBob"
            };

            //------------Execute Test---------------------------
            var ODBCServer = new ODBCDatabaseDesignerViewModel(ModelItemUtils.CreateModelItem(act), mod);
            var err        = ODBCServer.IsWorstErrorReadOnly;
            var errType    = ODBCServer.WorstError;

            //------------Assert Results-------------------------
            Assert.IsNotNull(errType);
            Assert.IsTrue(err);
        }
Exemplo n.º 4
0
        public void ODBCServer_LabelWidth()
        {
            //------------Setup for test--------------------------
            var id  = Guid.NewGuid();
            var mod = new ODBCServerModel();
            var act = new DsfODBCDatabaseActivity
            {
                SourceId = mod.Sources[0].Id,
                Inputs   = new List <IServiceInput>()
                {
                    new ServiceInput("[[a]]", "asa")
                },
                Outputs = new List <IServiceOutputMapping> {
                    new ServiceOutputMapping("a", "b", "c"), new ServiceOutputMapping("d", "e", "f")
                },
                ServiceName = "dsfBob"
            };

            //------------Execute Test---------------------------
            var ODBCServer = new ODBCDatabaseDesignerViewModel(ModelItemUtils.CreateModelItem(act), mod);
            var width      = ODBCServer.LabelWidth;

            //------------Assert Results-------------------------

            Assert.IsNotNull(width);
        }
Exemplo n.º 5
0
        public void ODBCServer_VerifyCommandTimeout()
        {
            //------------Setup for test--------------------------
            var mod = new ODBCServerModel();
            var act = new DsfODBCDatabaseActivity();

            //------------Execute Test---------------------------
            using (var vm = new ODBCDatabaseDesignerViewModel(ModelItemUtils.CreateModelItem(act), mod))
            {
                vm.InputArea.CommandTimeout = 321;
                //------------Assert Results-------------------------
                var dbService = vm.ToModel();
                Assert.AreEqual(321, dbService.CommandTimeout);
            }
        }
Exemplo n.º 6
0
        public void ODBCServer_MethodName_ClearErrors()
        {
            //------------Setup for test--------------------------
            var id  = Guid.NewGuid();
            var mod = new ODBCServerModel();
            var act = new DsfODBCDatabaseActivity();

            var ODBCServer = new ODBCDatabaseDesignerViewModel(ModelItemUtils.CreateModelItem(act), mod);

            //------------Execute Test---------------------------
            ODBCServer.ClearValidationMemoWithNoFoundError();
            //------------Assert Results-------------------------
            Assert.IsNull(ODBCServer.Errors);
            Assert.AreEqual(ODBCServer.DesignValidationErrors.Count, 1);
        }
Exemplo n.º 7
0
        public void ODBCServer_Ctor_EmptyModelItem()
        {
            //------------Setup for test--------------------------
            var id  = Guid.NewGuid();
            var mod = new ODBCServerModel();
            var act = new DsfODBCDatabaseActivity();

            //------------Execute Test---------------------------
            var ODBCServer = new ODBCDatabaseDesignerViewModel(ModelItemUtils.CreateModelItem(act), mod);

            //------------Assert Results-------------------------
            Assert.IsTrue(ODBCServer.SourceRegion.IsEnabled);
            Assert.IsFalse(ODBCServer.OutputsRegion.IsEnabled);
            Assert.IsFalse(ODBCServer.InputArea.IsEnabled);
            Assert.IsTrue(ODBCServer.ErrorRegion.IsEnabled);
        }
Exemplo n.º 8
0
        public void ODBCServer_TestActionSetSourceAndTestClickOkHasMappings()
        {
            //------------Setup for test--------------------------
            var id  = Guid.NewGuid();
            var mod = new ODBCServerModel();
            var act = new DsfODBCDatabaseActivity();

            //------------Execute Test---------------------------
            var ODBCServer = new ODBCDatabaseDesignerViewModel(ModelItemUtils.CreateModelItem(act), mod);

            ODBCServer.SourceRegion.SelectedSource = ODBCServer.SourceRegion.Sources.First();
#pragma warning restore 4014

            //------------Assert Results-------------------------
            Assert.IsTrue(ODBCServer.SourceRegion.IsEnabled);
            Assert.IsTrue(ODBCServer.ErrorRegion.IsEnabled);
            Assert.AreEqual(0, ODBCServer.ManageServiceInputViewModel.Errors.Count);
        }
Exemplo n.º 9
0
        public void ODBCServer_TestActionSetSource()
        {
            //------------Setup for test--------------------------
            var id  = Guid.NewGuid();
            var mod = new ODBCServerModel();
            var act = new DsfODBCDatabaseActivity();

            //------------Execute Test---------------------------
            var ODBCServer = new ODBCDatabaseDesignerViewModel(ModelItemUtils.CreateModelItem(act), mod);

            ODBCServer.ManageServiceInputViewModel = new InputViewForTest(ODBCServer, mod);
            ODBCServer.SourceRegion.SelectedSource = ODBCServer.SourceRegion.Sources.First();

            //------------Assert Results-------------------------
            Assert.IsTrue(ODBCServer.SourceRegion.IsEnabled);
            Assert.IsFalse(ODBCServer.OutputsRegion.IsEnabled);
            Assert.IsTrue(ODBCServer.ErrorRegion.IsEnabled);
        }