Beispiel #1
0
        // dotnet test --filter "FullyQualifiedName=damper_dan_client.tests.FacilitiesEngineerTest.GetDampersTest"
        public async Task GetDampersTest()
        {
            Console.WriteLine("FacilitiesEngineer");
            var optionsBuilder = new DbContextOptionsBuilder <DamperContext>();

            optionsBuilder.UseMySql("Server=localhost;Database=tstrat_damper;User=root;Password=;");

            using (DamperContext ctx = new DamperContext(optionsBuilder.Options)) {
                Dampers d = new FacilitiesController(ctx);
                (await d.GetDampers()).ForEach(s => Console.WriteLine(s.alias_id));
            }
        }
Beispiel #2
0
        // dotnet test --filter "FullyQualifiedName=damper_dan_client.tests.FacilitiesEngineerTest.GetDampersByBuildingTest"
        public async Task GetDampersByBuildingTest()
        {
            Console.WriteLine("FacilitiesEngineer - Getting Dampers by Building");
            var optionsBuilder = new DbContextOptionsBuilder <DamperContext>();

            optionsBuilder.UseMySql("Server=localhost;Database=tstrat_damper;User=root;Password=;");

            using (DamperContext ctx = new DamperContext(optionsBuilder.Options)) {
                Dampers d        = new FacilitiesController(ctx);
                var     building = (await d.GetDampers())[1]; // Let just get the first building on the list
                (await d.GetDampersByBuilding(building.id)).ForEach(s => Console.WriteLine(s.alias_id));
            }
        }