public void AssureReferenceFriendIsNotPartOfTheResult()
        {
            Task.Run(async() => {
                var mockFriendRepository = new Mock <IFriendRepository>();
                mockFriendRepository.Setup(x => x.GetAllLazy()).Returns(() => getDefaultFriendList());

                var friends = await getDefaultFriendList();
                var friend  = friends.OrderBy(x => Guid.NewGuid()).FirstOrDefault();

                var nearestFriendsService = new NearestFriendsService(mockFriendRepository.Object);

                var nearestFriends = await nearestFriendsService.GetNearestFriends(friend);

                Assert.AreEqual(false, nearestFriends.All(x => x.Id != friend.Id));
            });
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Task.Run(async() =>
            {
                var container = WindsorBootstrap.Start();

                await InitializePersistency(container);

                _friendsListService    = container.Resolve <FriendsListService>();
                _nearestFriendsService = container.Resolve <NearestFriendsService>();

                bool visitAgain;

                do
                {
                    visitAgain = await VisitFriend();
                } while (visitAgain);
            }).GetAwaiter().GetResult();
        }