コード例 #1
0
    public void BehaviorProfiles_FacetExists_ShouldReturnContactBehaviorProfiles([NoAutoProperties] ContactProfileProvider provider, IContactBehaviorProfilesContext facet, ITracker tracker, [Substitute] Contact contact)
    {
      tracker.IsActive.Returns(true);
      tracker.Contact.Returns(contact);
      contact.BehaviorProfiles.Returns(facet);

      using (new TrackerSwitcher(tracker))
      {
        provider.BehaviorProfiles.Should().NotBeNull();
        provider.BehaviorProfiles.ShouldBeEquivalentTo(facet.Profiles);
      }
    }
コード例 #2
0
        public void BehaviorProfiles_FacetExists_ShouldReturnContactBehaviorProfiles([NoAutoProperties] ContactFacetsProvider provider, IContactBehaviorProfilesContext facet, ITracker tracker, [Substitute] Contact contact)
        {
            // Arrange
            tracker.IsActive.Returns(true);
            tracker.Contact.Returns(contact);
            contact.BehaviorProfiles.Returns(facet);

            using (new TrackerSwitcher(tracker))
            {
                // Act / Assert
                provider.BehaviorProfiles.Should().NotBeNull();
                provider.BehaviorProfiles.Should().BeEquivalentTo(facet.Profiles);
            }
        }