Beispiel #1
0
        public async Task GetCurrentContactAsync_CorrectEnvironment_GetsAndSetsContact(string userName, string expectedCallingUserName)
        {
            // Arrange
            var expectedContact = new ContactInfo
            {
                ContactLastName = "TestContact"
            };

            mCurrectContactProvider.GetCurrentContact(Arg.Any <IUserInfo>(), false).Returns(expectedContact);

            // Act
            var result = await mContactTrackingService.GetCurrentContactAsync(userName);

            // Assert
            CMSAssert.All(
                () => Assert.That(result, Is.SameAs(expectedContact), "Result contact should be the same as the expected one"),
                () => mCurrectContactProvider.Received(1).GetCurrentContact(Arg.Any <IUserInfo>(), Arg.Any <bool>()),
                () => mCurrectContactProvider.Received(1).SetCurrentContact(Arg.Any <ContactInfo>())
                );
        }