public async Task StandardDataModel_AddComponent_AddsComponentToDictionaryWithoutNewRead() { var dataModel = new StandardDataModel(databaseSubstitute); var components = await dataModel.GetHardwareComponents(); await dataModel.CreateNewComponent(new HardwareComponent("#1", 10, 5, 100, "B", "empty", 60)); Assert.AreEqual(3, components.Count); }
public async Task StandardDataModel_AddComponentAlreadyExists_OverwritesComponent() { var dataModel = new StandardDataModel(databaseSubstitute); var components = await dataModel.GetHardwareComponents(); await dataModel.CreateNewComponent(new HardwareComponent("#2", 10, 5, 100, "B", "empty", 60)); components.TryGetValue("#2", out var component); Assert.AreEqual("B", component.componentName); }