Fix tests

This commit is contained in:
jvyden 2021-10-20 18:30:20 -04:00
parent e63a4b812a
commit c0ef2f107e
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
3 changed files with 8 additions and 9 deletions

View file

@ -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);
}
}
}

View file

@ -22,14 +22,6 @@ namespace ProjectLighthouse {
MySqlServerVersion.LatestSupportedServerVersion
);
protected override void OnModelCreating(ModelBuilder modelBuilder) {
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<Slot>()
.Property<string>(nameof(Slot.ResourceCollection))
.HasField(nameof(Slot.ResourceCollection));
}
public async Task<User> CreateUser(string username) {
User user;
if((user = await Users.Where(u => u.Username == username).FirstOrDefaultAsync()) != null)

View file

@ -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")]