public void AddSelf_Should_Throw_ArgumentNullException() { // Arrange var policyBuilder = new PolicyBuilder <object>(); // Act Action act = () => policyBuilder.AddSelf(null); // Assert act.Should().Throw <ArgumentNullException>(); }
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(); }
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(); }