felder Frieren nun nicht mehr ein, problem lag beim Databinding. Fand Statt im on load methode, dies führte dazu dass beim datumpicker, der noch nicht angezeigt wurde, die felder einfrieren. Schnittstelle für Temperatur erweitert. Beim schließen des forms, wird die Straßenliste neugebaut
102 lines
3.3 KiB
C#
102 lines
3.3 KiB
C#
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
using KlassenBIB;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Xaml;
|
|
|
|
namespace KlassenBIB.Tests
|
|
{
|
|
[TestClass()]
|
|
public class InspektionsobjektTests
|
|
{
|
|
[TestMethod()]
|
|
public void XAMLDeserializeTest()
|
|
{
|
|
string filepath = @"C:\Users\OBremer\Desktop\SanVerwaltung\KlassenBIB\database.xaml";
|
|
var x = XamlServices.Load(filepath) as KlassenBIB.Projekt;
|
|
}
|
|
|
|
[TestMethod()]
|
|
public void XAMLSerializeTest()
|
|
{
|
|
Projekt projekt = new Projekt();
|
|
projekt.Nummer = "16/219";
|
|
projekt.Ort = "Oldenburg";
|
|
|
|
AbwasserTechnischeAnlageCollection abwasserTechnischeAnlageCollection = new AbwasserTechnischeAnlageCollection();
|
|
|
|
|
|
Inspektionsobjekt inspektionsobjekt = new Inspektionsobjekt();
|
|
inspektionsobjekt.Objektbezeichnung = "122345";
|
|
inspektionsobjekt.StrasseName = "Dieselstraße";
|
|
inspektionsobjekt.OrtName = "Meppen";
|
|
inspektionsobjekt.Projektnummer = "18-850-034";
|
|
inspektionsobjekt.Schadenskuerzeln.Add(new Inspektionskuerzeln()
|
|
{
|
|
Hauptkode = "BCD",
|
|
Charakterisierung1 = "XP"
|
|
});
|
|
inspektionsobjekt.Schadenskuerzeln.Add(new Inspektionskuerzeln()
|
|
{
|
|
Hauptkode = "BCA",
|
|
Charakterisierung1 = "A",
|
|
Charakterisierung2 = "A",
|
|
Quantifizierung1 = 150,
|
|
Quantifizierung2 = 150,
|
|
});
|
|
|
|
InlinerSanierung inliner = new InlinerSanierung();
|
|
inliner.Guid = Guid.NewGuid();
|
|
inliner.TempAusen = 1;
|
|
inliner.STVOAbsicherung = true;
|
|
inliner.DatumKalibrierung = DateTime.Now;
|
|
inliner.HDReinigungDatum = DateTime.Now;
|
|
inliner.SanierungsDatum = DateTime.Now;
|
|
inspektionsobjekt.Sanierung = inliner;
|
|
//inliner.InspektionsObjekt = inspektionsobjekt;
|
|
|
|
abwasserTechnischeAnlageCollection.Add(inspektionsobjekt);
|
|
|
|
projekt.Objekte.Add(inspektionsobjekt);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
XamlServices.Save("projekt1.xaml", projekt);
|
|
}
|
|
[TestMethod()]
|
|
public void InspektionsobjektTest()
|
|
{
|
|
Projekt projekt = new Projekt();
|
|
projekt.Ort = "Oldenburg";
|
|
|
|
|
|
|
|
Inspektionsobjekt inspektionsobjekt = new Inspektionsobjekt();
|
|
inspektionsobjekt.Objektbezeichnung = "SW01";
|
|
inspektionsobjekt.VonPunkt = "SW01";
|
|
inspektionsobjekt.BisPunkt = "SW02";
|
|
inspektionsobjekt.Haltungslaenge = 10;
|
|
inspektionsobjekt.RohrMaterial = "Steinzeug";
|
|
inspektionsobjekt.Kanalrohrweite = 150;
|
|
|
|
InlinerSanierung sanierung = new InlinerSanierung();
|
|
//sanierung.InspektionsObjekt = inspektionsobjekt;
|
|
sanierung.Guid = Guid.NewGuid();
|
|
sanierung.WasserhaltungEingerichtet = true;
|
|
sanierung.DatumKalibrierung = DateTime.Now;
|
|
|
|
inspektionsobjekt.Sanierung = sanierung;
|
|
|
|
|
|
//Assert.AreEqual(sanierung.GesamtHarzBedarf, 18m);
|
|
|
|
}
|
|
}
|
|
}
|