コード例 #1
0
        public void AddSelf_Should_Throw_ArgumentNullException()
        {
            // Arrange
            var policyBuilder = new PolicyBuilder <object>();

            // Act
            Action act = () => policyBuilder.AddSelf(null);

            // Assert
            act.Should().Throw <ArgumentNullException>();
        }
コード例 #2
0
        public void AddSelf_Should_AddLinkToPolicyInMemoryRepository()
        {
            // Arrange
            var policyBuilder = new PolicyBuilder <object>();

            // Act
            policyBuilder.AddSelf(o => o);

            // Assert
            PolicyInMemoryRepository.LinksPolicyInMemory
            .Any(p => p.Name.Equals(PolicyConstants.Self))
            .Should().BeTrue();
        }
コード例 #3
0
        public void InMemoryPolicyRepository_Should_AddSelfPolicy_ToInMemoryDictionary()
        {
            // Arrange
            var policy = new PolicyBuilder <InMemoryTestViewModel>();

            // Act
            policy.AddSelf(x => x.Title);

            // Assert
            InMemoryPolicyRepository.InMemoryPolicies
            .First(p => p is InMemoryPolicyRepository.SelfPolicy)
            .Should()
            .NotBeNull();
        }