Beispiel #1
0
        public void ToSeatModel_With_PlayerId_Should_Return_Seat_With_Valid_Values()
        {
            var tableId = Guid.NewGuid();
            var seat = new Seat
            {
                Id = 1,
                IsDealer = true,
                PlayerId = Guid.NewGuid()
            };
            var seatEntity = seat.ToSeatEntity(tableId);
            var seatModel = seatEntity.ToSeatModel();

            Assert.IsNotNull(seatModel);
            Assert.IsInstanceOfType(seatModel, typeof(Seat));
            Assert.AreEqual(seat.Id, seatModel.Id);
            Assert.AreEqual(seat.IsDealer, seatModel.IsDealer);
            Assert.AreEqual(seat.PlayerId, seatModel.PlayerId);
        }
Beispiel #2
0
        public void ToSeatEntity_With_ValidPlayerID_Should_Return_SeatEntity_With_Valid_Values()
        {
            var tableId = Guid.NewGuid();
            var seat = new Seat
            {
                Id = 1,
                IsDealer = true,
                PlayerId = Guid.NewGuid()
            };
            var result = seat.ToSeatEntity(tableId);

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(SeatEntity));
            Assert.IsNotNull(seat.PlayerId);
            Assert.AreEqual(tableId.ToString(), result.PartitionKey);
            Assert.AreEqual(string.Format("Seat-{0}", seat.Id), result.RowKey);
            Assert.AreEqual(seat.Id, result.SeatId);
            Assert.AreEqual(seat.IsDealer, result.IsDealer);
            Assert.AreEqual(seat.PlayerId.Value.ToString(), result.PlayerId);
        }