diff --git a/bibtalk/UnitTestProject1/Properties/AssemblyInfo.cs b/bibtalk/UnitTestProject1/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..92c2db2
--- /dev/null
+++ b/bibtalk/UnitTestProject1/Properties/AssemblyInfo.cs
@@ -0,0 +1,20 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("UnitTestProject1")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("UnitTestProject1")]
+[assembly: AssemblyCopyright("Copyright © 2024")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: ComVisible(false)]
+
+[assembly: Guid("5ab576d6-0fab-4721-acc8-e94e9cdba4bc")]
+
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/bibtalk/UnitTestProject1/UnitTest1.cs b/bibtalk/UnitTestProject1/UnitTest1.cs
new file mode 100644
index 0000000..cb81000
--- /dev/null
+++ b/bibtalk/UnitTestProject1/UnitTest1.cs
@@ -0,0 +1,14 @@
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System;
+
+namespace UnitTestProject1
+{
+ [TestClass]
+ public class UnitTest1
+ {
+ [TestMethod]
+ public void TestMethod1()
+ {
+ }
+ }
+}
diff --git a/bibtalk/UnitTestProject1/UnitTestProject1.csproj b/bibtalk/UnitTestProject1/UnitTestProject1.csproj
new file mode 100644
index 0000000..5f3c603
--- /dev/null
+++ b/bibtalk/UnitTestProject1/UnitTestProject1.csproj
@@ -0,0 +1,68 @@
+
+
+
+
+
+ Debug
+ AnyCPU
+ {5AB576D6-0FAB-4721-ACC8-E94E9CDBA4BC}
+ Library
+ Properties
+ UnitTestProject1
+ UnitTestProject1
+ v4.7.2
+ 512
+ {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 15.0
+ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+ $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages
+ False
+ UnitTest
+
+
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll
+
+
+ ..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
+
+
\ No newline at end of file
diff --git a/bibtalk/UnitTestProject1/packages.config b/bibtalk/UnitTestProject1/packages.config
new file mode 100644
index 0000000..36cbc3e
--- /dev/null
+++ b/bibtalk/UnitTestProject1/packages.config
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/bibtalk/UnitTestProject2/Properties/AssemblyInfo.cs b/bibtalk/UnitTestProject2/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..8380438
--- /dev/null
+++ b/bibtalk/UnitTestProject2/Properties/AssemblyInfo.cs
@@ -0,0 +1,20 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("UnitTestProject2")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("UnitTestProject2")]
+[assembly: AssemblyCopyright("Copyright © 2024")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: ComVisible(false)]
+
+[assembly: Guid("2206e204-1087-4204-b79d-1880c23798eb")]
+
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/bibtalk/UnitTestProject2/UnitTest1.cs b/bibtalk/UnitTestProject2/UnitTest1.cs
new file mode 100644
index 0000000..525abc8
--- /dev/null
+++ b/bibtalk/UnitTestProject2/UnitTest1.cs
@@ -0,0 +1,15 @@
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System;
+
+namespace UnitTestProject2
+{
+ [TestClass]
+ public class UnitTest1
+ {
+ [TestMethod]
+ public void TestMethod1()
+ {
+
+ }
+ }
+}
diff --git a/bibtalk/UnitTestProject2/UnitTestProject2.csproj b/bibtalk/UnitTestProject2/UnitTestProject2.csproj
new file mode 100644
index 0000000..2f8ba2a
--- /dev/null
+++ b/bibtalk/UnitTestProject2/UnitTestProject2.csproj
@@ -0,0 +1,74 @@
+
+
+
+
+
+ Debug
+ AnyCPU
+ {2206E204-1087-4204-B79D-1880C23798EB}
+ Library
+ Properties
+ UnitTestProject2
+ UnitTestProject2
+ v4.7.2
+ 512
+ {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 15.0
+ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+ $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages
+ False
+ UnitTest
+
+
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll
+
+
+ ..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {92b3214e-6fb1-4d94-b93f-6f1a9d9f2224}
+ bib-talk
+
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
+
+
\ No newline at end of file
diff --git a/bibtalk/UnitTestProject2/packages.config b/bibtalk/UnitTestProject2/packages.config
new file mode 100644
index 0000000..36cbc3e
--- /dev/null
+++ b/bibtalk/UnitTestProject2/packages.config
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/bibtalk/UserTest/GlobalUsings.cs b/bibtalk/UserTest/GlobalUsings.cs
new file mode 100644
index 0000000..ab67c7e
--- /dev/null
+++ b/bibtalk/UserTest/GlobalUsings.cs
@@ -0,0 +1 @@
+global using Microsoft.VisualStudio.TestTools.UnitTesting;
\ No newline at end of file
diff --git a/bibtalk/UserTest/UnitTest1.cs b/bibtalk/UserTest/UnitTest1.cs
new file mode 100644
index 0000000..b38dd64
--- /dev/null
+++ b/bibtalk/UserTest/UnitTest1.cs
@@ -0,0 +1,11 @@
+namespace UserTest
+{
+ [TestClass]
+ public class UnitTest1
+ {
+ [TestMethod]
+ public void TestMethod1()
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/bibtalk/UserTest/UserTest.csproj b/bibtalk/UserTest/UserTest.csproj
new file mode 100644
index 0000000..06daf38
--- /dev/null
+++ b/bibtalk/UserTest/UserTest.csproj
@@ -0,0 +1,23 @@
+
+
+
+ net8.0
+ enable
+ enable
+
+ false
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bibtalk/UserTests/Fakes/bib-talk.fakes b/bibtalk/UserTests/Fakes/bib-talk.fakes
new file mode 100644
index 0000000..ea38044
Binary files /dev/null and b/bibtalk/UserTests/Fakes/bib-talk.fakes differ
diff --git a/bibtalk/UserTests/GlobalUsings.cs b/bibtalk/UserTests/GlobalUsings.cs
new file mode 100644
index 0000000..ab67c7e
--- /dev/null
+++ b/bibtalk/UserTests/GlobalUsings.cs
@@ -0,0 +1 @@
+global using Microsoft.VisualStudio.TestTools.UnitTesting;
\ No newline at end of file
diff --git a/bibtalk/UserTests/UnitTest1.cs b/bibtalk/UserTests/UnitTest1.cs
new file mode 100644
index 0000000..8dfd8b7
--- /dev/null
+++ b/bibtalk/UserTests/UnitTest1.cs
@@ -0,0 +1,12 @@
+namespace UserTests
+{
+ [TestClass]
+ public class UnitTest1
+ {
+ [TestMethod]
+ public void TestMethod1()
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/bibtalk/UserTests/UserTests.csproj b/bibtalk/UserTests/UserTests.csproj
new file mode 100644
index 0000000..37be7b0
--- /dev/null
+++ b/bibtalk/UserTests/UserTests.csproj
@@ -0,0 +1,34 @@
+
+
+
+ net6.0
+ enable
+ enable
+
+ false
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bibtalk/bib-talk.sln b/bibtalk/bib-talk.sln
index 42d0166..a82996c 100644
--- a/bibtalk/bib-talk.sln
+++ b/bibtalk/bib-talk.sln
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33213.308
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bib-talk", "bib-talk\bib-talk.csproj", "{92B3214E-6FB1-4D94-B93F-6F1A9D9F2224}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "bib-talk", "bib-talk\bib-talk.csproj", "{92B3214E-6FB1-4D94-B93F-6F1A9D9F2224}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/bibtalk/bib-talk/Business/LoginManager.cs b/bibtalk/bib-talk/Business/LoginManager.cs
index e711d6a..95eaa54 100644
--- a/bibtalk/bib-talk/Business/LoginManager.cs
+++ b/bibtalk/bib-talk/Business/LoginManager.cs
@@ -1,4 +1,9 @@
using bib_talk.Repository;
+using Newtonsoft.Json;
+using System.Net.Http;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
namespace bib_talk.Business
{
@@ -15,5 +20,29 @@ namespace bib_talk.Business
{
await loginDatabase.LoginServer();
}
+
+ public async Task LoginBots(string username, string password)
+ {
+ var loginData = new { Username = username, Password = password, Email = "", Birthday = "", IsOnline = "" };
+ string json = JsonConvert.SerializeObject(loginData);
+
+ using (var client = new HttpClient())
+ {
+ var content = new StringContent(json, Encoding.UTF8, "application/json");
+ var response = await client.PostAsync("http://daddypig.dns.navy:5114/api/users/login", content);
+
+ if (response.IsSuccessStatusCode)
+ {
+ var responseContent = await response.Content.ReadAsStringAsync();
+ var responseData = JsonConvert.DeserializeObject(responseContent);
+
+ }
+ else
+ {
+ var responseContent = await response.Content.ReadAsStringAsync();
+ MessageBox.Show($"Login failed: {responseContent}");
+ }
+ }
+ }
}
}
diff --git a/bibtalk/bib-talk/Business/RegisterManager.cs b/bibtalk/bib-talk/Business/RegisterManager.cs
index 893a25a..c370c27 100644
--- a/bibtalk/bib-talk/Business/RegisterManager.cs
+++ b/bibtalk/bib-talk/Business/RegisterManager.cs
@@ -1,4 +1,8 @@
using bib_talk.Repository;
+using Newtonsoft.Json;
+using System.Net.Http;
+using System.Text;
+using System.Windows;
namespace bib_talk.Business
{
@@ -15,5 +19,26 @@ namespace bib_talk.Business
{
await registerDatabase.RegisterServer();
}
+
+ public async void RegisterBots(string username, string password, string email, string birthday)
+ {
+ var newUser = new { Username = username, Password = password, Email = email, Birthday = birthday, IsOnline = "" };
+ string json = JsonConvert.SerializeObject(newUser);
+
+ using (var client = new HttpClient())
+ {
+ var content = new StringContent(json, Encoding.UTF8, "application/json");
+ var response = await client.PostAsync("http://daddypig.dns.navy:5114/api/users/register", content);
+
+ if (response.IsSuccessStatusCode)
+ {
+ MessageBox.Show("Registrierung erfolgreich.");
+ }
+ else
+ {
+ MessageBox.Show("Registrierung fehlgeschlagen. " + response);
+ }
+ }
+ }
}
}
diff --git a/bibtalk/bib-talk/UI/Login.xaml b/bibtalk/bib-talk/UI/Login.xaml
index a4d6c58..afe36d0 100644
--- a/bibtalk/bib-talk/UI/Login.xaml
+++ b/bibtalk/bib-talk/UI/Login.xaml
@@ -134,6 +134,6 @@
-
+
diff --git a/bibtalk/bib-talk/UI/Login.xaml.cs b/bibtalk/bib-talk/UI/Login.xaml.cs
index 3f1dfb8..d5d83b2 100644
--- a/bibtalk/bib-talk/UI/Login.xaml.cs
+++ b/bibtalk/bib-talk/UI/Login.xaml.cs
@@ -3,6 +3,7 @@ using System.Windows.Media;
using System.Windows;
using bib_talk.Business;
using System.Windows.Controls;
+using System.Threading;
namespace bib_talk
{
@@ -88,5 +89,19 @@ namespace bib_talk
}
}
}
- }
+
+ private void LoginBotUser(object sender, RoutedEventArgs e)
+ {
+ // for (int i = 1; i <= 100; i++)
+ // {
+ // string name = "Bot";
+ // string password = "Bot123";
+ // loginManager.LoginBots(name + i, password);
+ // Thread.Sleep(1000);
+ //}
+
+
+
+ }
+ }
}
diff --git a/bibtalk/bib-talk/UI/RegisterWindow.xaml.cs b/bibtalk/bib-talk/UI/RegisterWindow.xaml.cs
index 21de0aa..eb4bfcd 100644
--- a/bibtalk/bib-talk/UI/RegisterWindow.xaml.cs
+++ b/bibtalk/bib-talk/UI/RegisterWindow.xaml.cs
@@ -1,6 +1,7 @@
using System;
using System.Diagnostics;
using System.Text.RegularExpressions;
+using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
@@ -159,6 +160,19 @@ namespace bib_talk
}
}
-
- }
+
+ // Benutzt um 100 User accounts zu erstellen
+ //private void RegisterNewBots(object sender, RoutedEventArgs e)
+ //{
+ // for (int i = 10; i <= 100; i++)
+ // {
+ // string name = "Bot";
+ // string password = "Bot123";
+ // string email = "bot@edu.bib.de";
+ // string birthday = "12.12.2000";
+ // registerManager.RegisterBots(name + i, password, i + email, birthday);
+ // Thread.Sleep(1000);
+ // }
+ //}
+ }
}