Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Behavioral.Automation.DemoBindings/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public void Bootstrap()
Assert.SetRunner(_runner);
_objectContainer.RegisterTypeAs<UserInterfaceBuilder, IUserInterfaceBuilder>();
_servicesBuilder.Build();
Assert.SetConsumer(_objectContainer.Resolve<IScenarioExecutionConsumer>());
_browserRunner.OpenChrome();
}
}
Expand Down
4 changes: 0 additions & 4 deletions src/Behavioral.Automation.UnitTests/AssertionBuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ public void OneTimeSetup()
Mock<ITestRunnerWrapper> wrapperMock = new Mock<ITestRunnerWrapper>();
wrapperMock.Setup(w => w.StepInfoText).Returns("TEST");

Mock<IScenarioExecutionConsumer> consumerMock = new Mock<IScenarioExecutionConsumer>();
consumerMock.Setup(c => c.Get()).Returns(new[] { "TEST STEP" });

BAssert.SetRunner(wrapperMock.Object);
BAssert.SetConsumer(consumerMock.Object);
}

[TestCase(0, false)]
Expand Down
36 changes: 0 additions & 36 deletions src/Behavioral.Automation/Bindings/ExecutionObserverBinding.cs

This file was deleted.

21 changes: 3 additions & 18 deletions src/Behavioral.Automation/FluentAssertions/Assert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Behavioral.Automation.FluentAssertions.Abstractions;
using Behavioral.Automation.Model;
using Behavioral.Automation.Services;
using NUnit.Framework;
using OpenQA.Selenium;
using TechTalk.SpecFlow;

Expand All @@ -15,7 +16,6 @@ public static class Assert
{
private const int DefaultAttempts = 30;
private static ITestRunnerWrapper _runner;
private static IScenarioExecutionConsumer _consumer;

public static void SetRunner(ITestRunner runner)
{
Expand All @@ -27,11 +27,6 @@ public static void SetRunner(ITestRunnerWrapper runner)
_runner = runner;
}

public static void SetConsumer(IScenarioExecutionConsumer consumer)
{
_consumer = consumer;
}

public static T ShouldGet<T>(Func<T> predicate)
{
return TryGetValue(predicate, TimeSpan.FromMilliseconds(500));
Expand Down Expand Up @@ -93,7 +88,8 @@ public static void True(bool condition, string message)
{
if (!condition)
{
NUnit.Framework.Assert.Fail(BuildMessage(message));
TestContext.WriteLine($"\nActual:\n{message}");
NUnit.Framework.Assert.Fail();
}
}

Expand All @@ -107,17 +103,6 @@ public static string BehaviorAppendix(this AssertionBehavior behavior)
return string.Empty;
}

private static string BuildMessage(string message)
{
IEnumerable<string> executedSteps = _consumer.Get();
string aggregatedSteps = "";
if (executedSteps.Any())
{
aggregatedSteps = _consumer.Get().Aggregate((x, y) => $"{x}\n{y}");
}
return $"{aggregatedSteps}\n\nExpected:\n{_runner.StepInfoText}\nActual:\n{message}";
}

private static T TryGetValue<T>(Func<T> getValue, TimeSpan wait, int attempts = 10)
{
var counter = 0;
Expand Down
11 changes: 0 additions & 11 deletions src/Behavioral.Automation/Services/IScenarioExecutionConsumer.cs

This file was deleted.

19 changes: 0 additions & 19 deletions src/Behavioral.Automation/Services/ScenarioExecutionConsumer.cs

This file was deleted.

1 change: 0 additions & 1 deletion src/Behavioral.Automation/TestServicesBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public TestServicesBuilder(IObjectContainer objectContainer)

public void Build()
{
_objectContainer.RegisterTypeAs<ScenarioExecutionConsumer, IScenarioExecutionConsumer>();
_objectContainer.RegisterTypeAs<DriverService, IDriverService>();
_objectContainer.RegisterTypeAs<ElementSelectionService, IElementSelectionService>();
_objectContainer.RegisterTypeAs<VirtualizedElementsSelectionService, IVirtualizedElementsSelectionService>();
Expand Down