aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.BootScreen/App.config
blob: 731f6de6c291e303814b02808f34140fe560e8e4 (plain)
1
2
3
4
5
6
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
    </startup>
</configuration>
g.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Tango.DAL;
using System.Linq;
using Tango.Settings;

namespace Tango.UnitTesting
{
    [TestClass]
    [TestCategory("DAL")]
    public class DAL_TST
    {
        [TestMethod]
        public void Validate_Server_SQLServer_Connection()
        {
            String guid = Guid.NewGuid().ToString();

            using (var db = new DAL.Remote.DB.RemoteDB(SettingsManager.Default.DataBase.SQLServerAddress, false))
            {
                var action = new DAL.Remote.DB.ACTION_TYPES();
                action.CODE = 1;
                action.NAME = "Action 1";
                action.DESCRIPTION = "Description 1";
                action.GUID = guid;
                action.LAST_UPDATED = DateTime.UtcNow;

                db.ACTION_TYPES.Add(action);
                db.SaveChanges();
            }

            using (var db = new DAL.Remote.DB.RemoteDB(SettingsManager.Default.DataBase.SQLServerAddress, false))
            {
                var action = db.ACTION_TYPES.Single(x => x.GUID == guid);
                db.ACTION_TYPES.Remove(action);
                db.SaveChanges();
            }
        }

        [TestMethod]
        public void Validate_Local_SQLite_Connection()
        {
            String guid = Guid.NewGuid().ToString();

            using (var db = new DAL.Local.DB.LocalDB(Helper.GetSQLiteFilePath()))
            {
                var action = new DAL.Local.DB.ACTION_TYPES();
                action.CODE = 1;
                action.NAME = "Action 1";
                action.DESCRIPTION = "Description 1";
                action.GUID = guid;

                db.ACTION_TYPES.Add(action);
                db.SaveChanges();
            }

            using (var db = new DAL.Local.DB.LocalDB(Helper.GetSQLiteFilePath()))
            {
                var actions = db.ACTION_TYPES.ToList();
                var action = db.ACTION_TYPES.Single(x => x.GUID == guid);
                db.ACTION_TYPES.Remove(action);
                db.SaveChanges();
            }
        }
    }
}