public async Task StandardDataModel_GetComponents_ReturnsComponents() { var dataModel = new StandardDataModel(databaseSubstitute); var components = await dataModel.GetHardwareComponents(); Assert.AreEqual(2, components.Count); }
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); }