From c0ef2f107e634833d0eeebf2c1dd49a8ead341b7 Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 20 Oct 2021 18:30:20 -0400 Subject: [PATCH] Fix tests --- ProjectLighthouse.Tests/Tests/SlotTests.cs | 7 +++++++ ProjectLighthouse/Database.cs | 8 -------- ProjectLighthouse/Types/Slot.cs | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ProjectLighthouse.Tests/Tests/SlotTests.cs b/ProjectLighthouse.Tests/Tests/SlotTests.cs index 415842b4..8f284901 100644 --- a/ProjectLighthouse.Tests/Tests/SlotTests.cs +++ b/ProjectLighthouse.Tests/Tests/SlotTests.cs @@ -20,6 +20,7 @@ namespace ProjectLighthouse.Tests { Name = "slotA", Location = l, LocationId = l.Id, + ResourceCollection = "", }; Slot slotB = new() { @@ -27,6 +28,7 @@ namespace ProjectLighthouse.Tests { Name = "slotB", Location = l, LocationId = l.Id, + ResourceCollection = "", }; database.Slots.Add(slotA); @@ -43,6 +45,11 @@ namespace ProjectLighthouse.Tests { Assert.NotEqual(respA, respB); Assert.DoesNotContain(respA, "slotB"); Assert.DoesNotContain(respB, "slotA"); + + // Cleanup + + database.Slots.Remove(slotA); + database.Slots.Remove(slotB); } } } \ No newline at end of file diff --git a/ProjectLighthouse/Database.cs b/ProjectLighthouse/Database.cs index db9d0ace..80adc373 100644 --- a/ProjectLighthouse/Database.cs +++ b/ProjectLighthouse/Database.cs @@ -22,14 +22,6 @@ namespace ProjectLighthouse { MySqlServerVersion.LatestSupportedServerVersion ); - protected override void OnModelCreating(ModelBuilder modelBuilder) { - base.OnModelCreating(modelBuilder); - - modelBuilder.Entity() - .Property(nameof(Slot.ResourceCollection)) - .HasField(nameof(Slot.ResourceCollection)); - } - public async Task CreateUser(string username) { User user; if((user = await Users.Where(u => u.Username == username).FirstOrDefaultAsync()) != null) diff --git a/ProjectLighthouse/Types/Slot.cs b/ProjectLighthouse/Types/Slot.cs index 0d56bf32..6217c9c3 100644 --- a/ProjectLighthouse/Types/Slot.cs +++ b/ProjectLighthouse/Types/Slot.cs @@ -31,7 +31,7 @@ namespace ProjectLighthouse.Types { [XmlElement("rootLevel")] public string RootLevel { get; set; } - public string ResourceCollection; + public string ResourceCollection { get; set; } [NotMapped] [XmlElement("resource")]