public Something([NotNull] ISomethingElse something) { Guard.ArgumentNotNull(something, nameof(something)); SomethingElse = something; Name = "SomethingElse.Name"; }
public Player(IUserArmor armor, IMessenger messenger, ISomethingElse somethingElse) { this.armor = armor; this.messenger = messenger; this.somethingElse = somethingElse; this.HitPoints = 100; this.Alive = true; this.Rage = 0; }
public void DefaultConvention_MostUsualTypes_Registered() { var container = new Container(cfg => cfg .Scan(scanner => { scanner.AssemblyContainingType <AutoWiringTester>(); scanner.WithDefaultConventions(); })); ISomething something = container.TryGetInstance <ISomething>(); // not null since it conforms to default convention Assert.That(something, Is.InstanceOf <Something>()); ISomethingElse somethingElse = container.TryGetInstance <ISomethingElse>(); // null since "NotSomethingElse" is not converered by the default convention Assert.That(somethingElse, Is.Null); }
public void Invoked_ForLazySutAndNullTest_ReturnsInstance( Lazy <Something> sut, [BeNull] ISomethingElse _) { using (new AssertionScope( )) { sut.Should( ) .NotBeNull( ); sut.IsValueCreated .Should( ) .BeFalse( ); Action action = () => { // ReSharper disable once UnusedVariable var actual = sut.Value; }; action.Should( ) .Throw <ArgumentNullException> ( ) .WithParameter("something"); } }
public SomethingUnderTest(ISomethingElse somethingElse) { _somethingElse = somethingElse; }
protected override void Given() { _result = "bar"; _fake = Fixture.Freeze <ISomethingElse>(); _fake.Expect(x => x.SayHello()).Return("hi"); }