You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.0 KiB
C#
41 lines
1.0 KiB
C#
using System;
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
using Übungen_LF6_WinFormanwendung;
|
|
|
|
|
|
namespace UnitTestÜbung
|
|
{
|
|
[TestClass]
|
|
public class UnitTest1
|
|
{
|
|
[TestMethod]
|
|
public void Test_PrüfzifferCheck()
|
|
{
|
|
|
|
UnitTestDemoISBN TestISBN = new UnitTestDemoISBN();
|
|
|
|
//ISBN-13: 9780345391803 (Hitchhykers Guide Through Galaxy)
|
|
string teststring = "9780345391803";
|
|
bool erwartet = true;
|
|
|
|
Assert.AreEqual(erwartet, TestISBN.pruefeISBN(teststring),"Falsche Erkennung als richtige Prüfziffer!");
|
|
|
|
}
|
|
|
|
[TestMethod]
|
|
public void Test_PrüfzifferErgaenzer()
|
|
{
|
|
|
|
UnitTestDemoISBN TestISBN = new UnitTestDemoISBN();
|
|
|
|
string teststring = "978034539180";
|
|
|
|
string erwartet = "9780345391803";
|
|
|
|
|
|
Assert.AreEqual(erwartet, TestISBN.ergaenzeISBN(teststring), "Falsche ISBN wird generiert!");
|
|
|
|
}
|
|
}
|
|
}
|