public void Serialize_writes_credentials_using_a_JSON_type_property(JsonCredentialsSerializer sut)
        {
            var credentials = new StubCredentials
            {
                InitialisationNumber = 5,
                Key  = "My key",
                Salt = "Salty goodness",
            };
            var result = sut.Serialize(credentials);

            Assert.That(result, Does.Match(@"\$type"), "Includes a $type element");
            Assert.That(result, Does.Match(@"^\{"), "Begins with an open-brace");
        }
        public void Serialize_creates_expected_json(StubCredentials credentials,
                                                    JsonCredentialsSerializer sut)
        {
            // Arrange
            credentials.InitialisationNumber = 5;
            credentials.Key  = "My key";
            credentials.Salt = "Salty goodness";

            var expectedJson = "{\"$type\":\"CSF.Security.Tests.Stubs.StubCredentials, CSF.Security.Tests\",\"Key\":\"My key\",\"Salt\":\"Salty goodness\",\"InitialisationNumber\":5}";

            // Act
            var result = sut.Serialize(credentials);

            // Assert
            Assert.That(result, Is.EqualTo(expectedJson));
        }