示例#1
0
        public void TestGetPotentialPartners(string playerId)
        {
            _mockPartnerAccessLayer.Setup(x => x.GetPotentialPartners(new Guid(playerId))).Returns(new List <Player>()
            {
                new Player()
                {
                    Id        = new Guid("00000000-0000-0000-0000-000000000001"),
                    UserId    = new Guid("00000000-0000-0000-0001-000000000000"),
                    FirstName = "Thashin",
                    LastName  = "Naidoo",
                    Handicap  = new Decimal(19.3),
                    Created   = _createdAt,
                    Modified  = _modifiedAt
                },
                new Player()
                {
                    Id        = new Guid("00000000-0000-0000-0000-000000000002"),
                    UserId    = new Guid("00000000-0000-0000-0002-000000000000"),
                    FirstName = "Michael",
                    LastName  = "Nelmes",
                    Handicap  = new Decimal(24.8),
                    Created   = _createdAt,
                    Modified  = _modifiedAt
                }
            });

            var expected = new List <Player>()
            {
                new Player()
                {
                    Id        = new Guid("00000000-0000-0000-0000-000000000001"),
                    UserId    = new Guid("00000000-0000-0000-0001-000000000000"),
                    FirstName = "Thashin",
                    LastName  = "Naidoo",
                    Handicap  = new Decimal(19.3),
                    Created   = _createdAt,
                    Modified  = _modifiedAt
                },
                new Player()
                {
                    Id        = new Guid("00000000-0000-0000-0000-000000000002"),
                    UserId    = new Guid("00000000-0000-0000-0002-000000000000"),
                    FirstName = "Michael",
                    LastName  = "Nelmes",
                    Handicap  = new Decimal(24.8),
                    Created   = _createdAt,
                    Modified  = _modifiedAt
                }
            };

            var actual = _sut.GetPotentialPartners(new Guid(playerId)) as ObjectResult;

            actual.StatusCode.Should().Be(200);
            actual.Value.Should().BeEquivalentTo(expected);
        }