Skip to content

Commit

Permalink
unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joao4all committed Jul 18, 2024
1 parent 52e0356 commit bd1628a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ namespace COMETwebapp.Tests.Components.Tabs

using COMET.Web.Common.Model.Configuration;
using COMET.Web.Common.Services.ConfigurationService;
using COMET.Web.Common.Services.SessionManagement;
using COMET.Web.Common.Test.Helpers;

using COMETwebapp.Components.EngineeringModel;
Expand Down Expand Up @@ -77,11 +78,17 @@ public void SetUp()
this.engineeringModelBodyViewModel = new Mock<IEngineeringModelBodyViewModel>();
this.engineeringModelBodyViewModel.Setup(x => x.OptionsTableViewModel).Returns(optionsTableViewModel.Object);

var engineeringModelSetup = new EngineeringModelSetup();

this.iteration = new Iteration
{
IterationSetup = new IterationSetup
{
Container = new EngineeringModelSetup()
Container = engineeringModelSetup
},
Container = new EngineeringModel
{
EngineeringModelSetup = engineeringModelSetup
}
};

Expand All @@ -96,6 +103,10 @@ public void SetUp()
this.viewModel.Setup(x => x.SelectedApplication).Returns(engineeringModelBodyApplication);
this.viewModel.Setup(x => x.SidePanels).Returns(new SourceList<TabPanelInformation>());

var sessionService = new Mock<ISessionService>();
sessionService.Setup(x => x.GetDomainOfExpertise(It.IsAny<Iteration>())).Returns(new DomainOfExpertise());

this.context.Services.AddSingleton(sessionService.Object);
this.context.Services.AddSingleton(this.viewModel.Object);
this.context.Services.AddSingleton(this.engineeringModelBodyViewModel.Object);
this.context.Services.AddSingleton(configuration.Object);
Expand Down
9 changes: 7 additions & 2 deletions COMETwebapp.Tests/Pages/TabsTestFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,18 @@ public void Setup()
this.engineeringModelBodyViewModel = new Mock<IEngineeringModelBodyViewModel>();
this.engineeringModelBodyViewModel.Setup(x => x.OptionsTableViewModel).Returns(optionsTableViewModel.Object);

var engineeringSetupModel = new EngineeringModelSetup();

this.iteration = new Iteration
{
IterationSetup = new IterationSetup
{
Container = new EngineeringModelSetup()
Container = engineeringSetupModel
},
Container = new EngineeringModel()
Container = new EngineeringModel
{
EngineeringModelSetup = engineeringSetupModel
}
};

var configuration = new Mock<IConfigurationService>();
Expand Down

0 comments on commit bd1628a

Please sign in to comment.