Example #1
0
        public async Task DeleteUserProfileByAccountId_UserProfileExists_ReturnsNull(int accountId)
        {
            // Arrange
            IUserProfileRepository userProfile = new UserProfileRepository(new SQLServerGateway(), new ConnectionStringData());

            // Act
            await userProfile.DeleteUserProfileByAccountId(accountId);

            var retrievedAccount = await userProfile.GetUserProfileByAccountId(accountId);

            // Assert
            Assert.IsNull(retrievedAccount);
        }
Example #2
0
        public async Task DeleteUserProfileByAccountId_UserProfileExists_ExecutionTimeLessThan400Milliseconds(int accountId, long expectedMaxExecutionTime)
        {
            // Arrange
            IUserProfileRepository userProfile = new UserProfileRepository(new SQLServerGateway(), new ConnectionStringData());

            // Act
            var timer = Stopwatch.StartNew();
            await userProfile.DeleteUserProfileByAccountId(accountId);

            timer.Stop();

            var actualExecutionTime = timer.ElapsedMilliseconds;

            Debug.WriteLine("Actual Execution Time: " + actualExecutionTime);

            // Assert
            Assert.IsTrue(actualExecutionTime <= expectedMaxExecutionTime);
        }