public void ReturnsTrue(TmNativeDefs.IfaceUser ifaceUser)
            {
                Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
                var tmUser1 = TmUser.CreateFromIfaceUser(ifaceUser);
                var tmUser2 = TmUser.CreateFromIfaceUser(ifaceUser);

                var result = tmUser1.Equals(tmUser2);

                result.Should().Be(true);
            }
            public void ReturnFalseForNull(TmNativeDefs.IfaceUser ifaceUser)
            {
                Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

                var tmUser = TmUser.CreateFromIfaceUser(ifaceUser);

                var result = tmUser.Equals(null);

                result.Should().Be(false);
            }
            public void ReturnsFalseForWrongComment(byte[] comment, TmNativeDefs.IfaceUser ifaceUser)
            {
                Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

                var tmUser1 = TmUser.CreateFromIfaceUser(ifaceUser);

                ifaceUser.Comment = comment;
                var tmUser2 = TmUser.CreateFromIfaceUser(ifaceUser);

                var result = tmUser1.Equals(tmUser2);

                result.Should().Be(false);
            }
            public void ReturnsFalseForWrongHandle(TmNativeDefs.IfaceUser ifaceUser)
            {
                Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

                var tmUser1 = TmUser.CreateFromIfaceUser(ifaceUser);

                ifaceUser.Handle += 1;
                var tmUser2 = TmUser.CreateFromIfaceUser(ifaceUser);

                var result = tmUser1 == tmUser2;

                result.Should().Be(false);
            }
            public void ReturnsFalseForWrongCreationTime(int creationTimeStamp, TmNativeDefs.IfaceUser ifaceUser)
            {
                Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

                var tmUser1 = TmUser.CreateFromIfaceUser(ifaceUser);

                ifaceUser.CreationTime = creationTimeStamp;
                var tmUser2 = TmUser.CreateFromIfaceUser(ifaceUser);

                var result = tmUser1 == tmUser2;

                result.Should().Be(false);
            }
            public void ReturnsFalseForWrongParentProcessId(TmNativeDefs.IfaceUser ifaceUser)
            {
                Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

                var tmUser1 = TmUser.CreateFromIfaceUser(ifaceUser);

                ifaceUser.Pid += 1;
                var tmUser2 = TmUser.CreateFromIfaceUser(ifaceUser);

                var result = tmUser1.Equals(tmUser2);

                result.Should().Be(false);
            }
            public void SetsCorrectValues(byte[] name,
                                          byte[] comment,
                                          int creationTime,
                                          string expectedName,
                                          string expectedComment)
            {
                Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

                var ifaceUser = A.Dummy <TmNativeDefs.IfaceUser>();

                ifaceUser.Name         = name;
                ifaceUser.Comment      = comment;
                ifaceUser.CreationTime = creationTime;

                var tmUser = TmUser.CreateFromIfaceUser(ifaceUser);

                tmUser.Name.Should().Be(expectedName);
                tmUser.Comment.Should().Be(expectedComment);
                tmUser.CreationTime.Should().Be(DateUtil.GetDateTimeFromTimestamp(creationTime));
            }