Ejemplo n.º 1
0
        public void AddCapabilityThrowsExceptionWithNullCapability()
        {
            var type = typeof(Person);

            var sut = new BuildHistory();

            Action action = () => sut.AddCapability(type, null !);

            action.Should().Throw <ArgumentNullException>();
        }
Ejemplo n.º 2
0
        public void AddCapabilityDoesNotStoreCapabilityWhenHistoryIsEmpty()
        {
            var type = typeof(Person);

            var capability = Substitute.For <IBuildCapability>();

            var sut = new BuildHistory();

            sut.AddCapability(type, capability);

            var actual = sut.GetCapability(type);

            actual.Should().BeNull();
        }
Ejemplo n.º 3
0
        public void GetCapabilityReturnsStoredCapability()
        {
            var type  = typeof(Address);
            var value = new Person();

            var capability = Substitute.For <IBuildCapability>();

            var sut = new BuildHistory();

            sut.Push(value);
            sut.AddCapability(type, capability);

            var actual = sut.GetCapability(type);

            actual.Should().Be(capability);
        }