Initial commit

This commit is contained in:
Husky
2018-05-16 17:24:22 +02:00
parent cb42b4e98a
commit 374eecf21d
17 changed files with 567 additions and 0 deletions

View File

@@ -0,0 +1,80 @@
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.Projektnummer = "16/219";
projekt.ProjektOrt = "Oldenburg";
AbwasserTechnischeAnlageCollection abwasserTechnischeAnlageCollection = new AbwasserTechnischeAnlageCollection();
Inspektionsobjekt inspektionsobjekt = new Inspektionsobjekt();
inspektionsobjekt.Objektbezeichnung = "122345";
inspektionsobjekt.schadenskuerzeln.Add(new Inspektionskuerzeln()
{
Hauptkode = "BCD",
Charakterisierung1 = "XP"
});
inspektionsobjekt.schadenskuerzeln.Add(new Inspektionskuerzeln()
{
Hauptkode = "BCA",
Charakterisierung1 = "A",
Charakterisierung2 = "A",
Quantifizierung1 = 150,
Quantifizierung2 = 150,
});
abwasserTechnischeAnlageCollection.Add(inspektionsobjekt);
Strasse strasse = new Strasse()
{
Ort = "Oldenburg",
Strassename = "Dieselstraße",
objekte = abwasserTechnischeAnlageCollection
};
projekt.adressen.Add(strasse);
XamlServices.Save("db.xaml", projekt);
}
[TestMethod()]
public void InspektionsobjektTest()
{
Inspektionsobjekt inspektionsobjekt = new Inspektionsobjekt();
inspektionsobjekt.Objektbezeichnung = "1232";
inspektionsobjekt.schadenskuerzeln.Add(new Inspektionskuerzeln()
{
Hauptkode = "BCA",
Charakterisierung1 = "A",
Charakterisierung2 = "A",
Quantifizierung1 = 150,
Quantifizierung2 = 150
});
XamlServices.Save("file.xaml", inspektionsobjekt);
}
}
}