Пример #1
0
            public void WhenValuesAndKeysAreTheSame_ShouldReturnTrue()
            {
                // Arrange
                var key1        = GetRandomString();
                var key2        = GetRandomString();
                var value1      = GetRandomString();
                var value2      = GetRandomInt();
                var dictionary1 = DictionaryBuilder <string, object> .Create()
                                  .WithItem(key1, value1)
                                  .WithItem(key2, value2)
                                  .Build();

                var dictionary2 = DictionaryBuilder <string, object> .Create()
                                  .WithItem(key1, value1)
                                  .WithItem(key2, value2)
                                  .Build();

                var sut = Create(dictionary1, dictionary2);
                // Pre-Assert
                // Act
                var result = sut.AreDeepEqual();

                // Assert
                Expect(result).To.Be.True();
            }
Пример #2
0
            public void WhenKeysAreTheSame_ButValuesAreDifferent_ShouldReturnFalse()
            {
                // Arrange
                var key1        = GetRandomString();
                var key2        = GetRandomString();
                var dictionary1 = DictionaryBuilder <string, object> .Create()
                                  .WithItem(key1, GetRandomString())
                                  .WithItem(key2, GetRandomInt())
                                  .Build();

                var dictionary2 = DictionaryBuilder <string, object> .Create()
                                  .WithItem(key1, GetRandomString())
                                  .WithItem(key2, GetRandomInt())
                                  .Build();

                var sut = Create(dictionary1, dictionary2);
                // Pre-Assert
                // Act
                var result = sut.AreDeepEqual();

                // Assert
                Expect(result).To.Be.False();
            }
Пример #3
0
            public void WhenDifferentNumberOfEntries_ShouldReturnFalse()
            {
                // Arrange
                var key1        = GetRandomString();
                var key2        = GetRandomString();
                var value1      = GetRandomString();
                var value2      = GetRandomInt();
                var dictionary1 = DictionaryBuilder <string, object> .Create()
                                  .WithItem(key1, value1)
                                  .Build();

                var dictionary2 = DictionaryBuilder <string, object> .Create()
                                  .WithItem(key1, value1)
                                  .WithItem(key2, value2)
                                  .Build();

                var sut = Create(dictionary1, dictionary2);
                // Pre-Assert
                // Act
                var result = sut.AreDeepEqual();

                // Assert
                Expect(result).To.Be.False();
            }