Пример #1
0
        public void ToUser_GoodUserRecord_ReturnsUser(bool isOnline)
        {
            var record = new UserRecord {
                Id = Guid.NewGuid(), Name = "user", IsOnline = isOnline
            };

            User result = NotifierConverter.ToUser(record);

            Assert.Equal(record.Id, result.Id);
            Assert.Equal(record.Name, result.Name);
            Assert.Equal(isOnline, result.IsOnline);
        }
Пример #2
0
        public void ToUser_NullUserRecord_ReturnsNull()
        {
            User result = NotifierConverter.ToUser(null);

            Assert.Equal(null, result);
        }
 public void SubscribeForReceivingUserState(Action <User> onUserStateChanged)
 {
     NotificationReceiver.SubscribeForReceivingUserState(x => onUserStateChanged(NotifierConverter.ToUser(x)));
 }