static void Main(string[] args) { Console.WriteLine("Hello World with Assembly Reference!"); var dependentClass = new DependentClass(); dependentClass.Method(); }
public Task <SmartSignalResult> AnalyzeResourcesAsync(AnalysisRequest analysisRequest, ITracer tracer, CancellationToken cancellationToken) { int[] obj = { 1, 2, 3 }; var dependent = new DependentClass(); SmartSignalResult smartSignalResult = new SmartSignalResult(); smartSignalResult.ResultItems.Add(new TestSignalResultItem( "test title - " + dependent.GetString() + " - " + dependent.ObjectToString(obj), analysisRequest.TargetResources.First())); return(Task.FromResult(smartSignalResult)); }
public void TestWithADummy() { var dependency = new DummyDependency(); var dependentClass = new DependentClass(dependency); const string param = "abc"; const int expectedResultOne = 1; var resultOne = dependentClass.GetValue(param); Assert.AreEqual(expectedResultOne, resultOne); }
public Task <List <Alert> > AnalyzeResourcesAsync(AnalysisRequest analysisRequest, ITracer tracer, CancellationToken cancellationToken) { int[] obj = { 1, 2, 3 }; var dependent = new DependentClass(); List <Alert> alerts = new List <Alert>(); alerts.Add(new TestAlert( "test title - " + dependent.GetString() + " - " + dependent.ObjectToString(obj), analysisRequest.TargetResources.First())); return(Task.FromResult(alerts)); }
public void ItShouldResolveTheInternalAndExternalDependency() { // Act DependentClass actual = GetService <DependentClass>(); // Assert actual.Should().NotBeNull(); actual.InternalAndExternalDependency .Should() .NotBeNull(); }
public void ItShouldProvideAnEmptyEnumerableWhereThereAreNoRegistrations() { // Act DependentClass actual = GetService <DependentClass>(); // Assert actual.Should().NotBeNull(); actual.ZeroDependencies .Should() .NotBeNull() .And.BeEmpty(); }
public void ItShouldResolveTheInternalInterfaceDependency() { // Act DependentClass actual = GetService <DependentClass>(); // Assert actual.Should().NotBeNull(); actual.InterfaceDependency .Should() .NotBeNull() .And.BeOfType <InternalInterfaceDependency>(); }
public void ItShouldResolveTheInternalFixedDependency() { // Act DependentClass actual = GetService <DependentClass>(); // Assert actual.Should().NotBeNull(); actual.FixedDependency .Should() .NotBeNull() .And.BeSameAs(ExpectedFixedDependency); }
public void ItShouldResolveAConcreteOnlyDependency() { // Act DependentClass actual = GetService <DependentClass>(); // Assert actual.Should().NotBeNull(); actual.ConcreteOnlyDependency .Should() .NotBeNull() .And.BeSameAs(ExpectedConcreteOnlyDependency); }
static void Main(string[] args) { Console.WriteLine("Hello World with NuGet!"); var location = Path.GetDirectoryName(typeof(Program).Assembly.Location); AssemblyLoadContext.Default.LoadFromAssemblyPath(Path.Combine(location !, "BaseLibrary.dll")); var dependentClass = new DependentClass(); dependentClass.Method(); }
public void ItShouldResolveAMixedDependencyClass() { // Act DependentClass actual = GetService <DependentClass>(); // Assert actual.Should().NotBeNull(); actual.MixedDependencyClass .Should() .NotBeNull() .And.BeSameAs(ExpectedMixedDependency); }
public void ItShouldProvideAnEnumerableForASingleDependency() { // Act DependentClass actual = GetService <DependentClass>(); // Assert actual.Should().NotBeNull(); actual.SingleDependencies .Should() .NotBeNull() .And.HaveCount(1) .And.ContainSingle(d => d.GetType() == typeof(SingleDependency)); }
public void ItShouldResolveAValueTypeDependency() { // Act DependentClass actual = GetService <DependentClass>(); // Assert actual.Should().NotBeNull(); actual.ValueTypeDependency .Should() .Be(ExpectedValueTypeDependency); actual.ValueTypeDependency.Guid .Should() .Be(ExpectedValueTypeDependency.Guid); }
public void TestWithAStub() { var dependency = new StubDependency(); var dependentClass = new DependentClass(dependency); const string param1 = "abc"; const string param2 = "xyz"; const int expectedResultOne = 1; const int expectedResultTwo = 2; var resultOne = dependentClass.GetValue(param1); var resultTwo = dependentClass.GetValue(param2); Assert.AreEqual(expectedResultOne, resultOne); Assert.AreEqual(expectedResultTwo, resultTwo); }
public void ItShouldResolveAnInterfaceOnlyDependency() { // Act DependentClass actual = GetService <DependentClass>(); // Assert actual.Should().NotBeNull(); DependentClass second = GetService <DependentClass>(); actual.InterfaceOnlyDependency .Should() .NotBeNull() .And.BeSameAs(second.InterfaceOnlyDependency); }
public void ItShouldResolveTheRegisteredMultipleDependencies() { // Act DependentClass actual = GetService <DependentClass>(); // Assert actual.Should().NotBeNull(); actual.MultipleDependencies .Should() .NotBeNull() .And.HaveCount(3) .And.ContainSingle(d => d.GetType() == typeof(MultipleDependency1)) .And.ContainSingle(d => d.GetType() == typeof(MultipleDependency2)) .And.ContainSingle(d => d.GetType() == typeof(MultipleDependency3)); }
public void ItShouldResolveAMixedDependencyClass() { // Act DependentClass actual = GetService <DependentClass>(); // Assert actual.Should().NotBeNull(); DependentClass second = GetService <DependentClass>(); actual.MixedDependencyClass .Should() .NotBeNull() .And.BeSameAs(actual.MixedDependencyInferface) .And.BeSameAs(second.MixedDependencyInferface) .And.BeSameAs(second.MixedDependencyClass); }
public void TestWithAMock() { var dependency = new MockDependency(); var dependentClass = new DependentClass(dependency); const string param1 = "abc"; const string param2 = "xyz"; const int expectedResultOne = 1; const int expectedResultTwo = 2; dependentClass.CallMeFirst(); var resultOne = dependentClass.CallMeTwice(param1); var resultTwo = dependentClass.CallMeTwice(param2); dependentClass.CallMeLast(); Assert.AreEqual(expectedResultOne, resultOne); Assert.AreEqual(expectedResultTwo, resultTwo); }
public void ItShouldResolveAConcreteOnlyDependency() { // Act DependentClass actual = GetService <DependentClass>(); // Assert actual.Should().NotBeNull(); DependentClass second = GetService <DependentClass>(); actual.ConcreteOnlyDependency1 .Should() .NotBeNull() .And.BeSameAs(second.ConcreteOnlyDependency1); actual.ConcreteOnlyDependency2 .Should() .NotBeNull() .And.BeSameAs(second.ConcreteOnlyDependency2); }
public void SetUp() { _disp = new Mock <IDisposable>(); _formattable = new Mock <IFormattable>(); _dependentClass = new DependentClass(_disp.Object, _formattable.Object, _i); }