mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-29 16:38:37 +00:00
Fix tests
This commit is contained in:
parent
e63a4b812a
commit
c0ef2f107e
3 changed files with 8 additions and 9 deletions
|
@ -20,6 +20,7 @@ namespace ProjectLighthouse.Tests {
|
||||||
Name = "slotA",
|
Name = "slotA",
|
||||||
Location = l,
|
Location = l,
|
||||||
LocationId = l.Id,
|
LocationId = l.Id,
|
||||||
|
ResourceCollection = "",
|
||||||
};
|
};
|
||||||
|
|
||||||
Slot slotB = new() {
|
Slot slotB = new() {
|
||||||
|
@ -27,6 +28,7 @@ namespace ProjectLighthouse.Tests {
|
||||||
Name = "slotB",
|
Name = "slotB",
|
||||||
Location = l,
|
Location = l,
|
||||||
LocationId = l.Id,
|
LocationId = l.Id,
|
||||||
|
ResourceCollection = "",
|
||||||
};
|
};
|
||||||
|
|
||||||
database.Slots.Add(slotA);
|
database.Slots.Add(slotA);
|
||||||
|
@ -43,6 +45,11 @@ namespace ProjectLighthouse.Tests {
|
||||||
Assert.NotEqual(respA, respB);
|
Assert.NotEqual(respA, respB);
|
||||||
Assert.DoesNotContain(respA, "slotB");
|
Assert.DoesNotContain(respA, "slotB");
|
||||||
Assert.DoesNotContain(respB, "slotA");
|
Assert.DoesNotContain(respB, "slotA");
|
||||||
|
|
||||||
|
// Cleanup
|
||||||
|
|
||||||
|
database.Slots.Remove(slotA);
|
||||||
|
database.Slots.Remove(slotB);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -22,14 +22,6 @@ namespace ProjectLighthouse {
|
||||||
MySqlServerVersion.LatestSupportedServerVersion
|
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) {
|
public async Task<User> CreateUser(string username) {
|
||||||
User user;
|
User user;
|
||||||
if((user = await Users.Where(u => u.Username == username).FirstOrDefaultAsync()) != null)
|
if((user = await Users.Where(u => u.Username == username).FirstOrDefaultAsync()) != null)
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace ProjectLighthouse.Types {
|
||||||
[XmlElement("rootLevel")]
|
[XmlElement("rootLevel")]
|
||||||
public string RootLevel { get; set; }
|
public string RootLevel { get; set; }
|
||||||
|
|
||||||
public string ResourceCollection;
|
public string ResourceCollection { get; set; }
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
[XmlElement("resource")]
|
[XmlElement("resource")]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue