Example #1
0
        public void Repository_AddPolicy_ReturnsPositiveId()
        {
            // Arrange
            var repository = new JsonRepository();
            var policy     = new Policy()
            {
                Firstname = "First", Surname = "Surname"
            };

            // Act
            var sut = repository.AddPolicy(policy);

            // Assert
            sut.Should().BePositive();
        }
Example #2
0
        public void Repository_AddPolicy_ValueIsStored()
        {
            // Arrange
            var repository = new JsonRepository();
            var policy     = new Policy()
            {
                Firstname = "First", Surname = "Surname"
            };
            var index = repository.AddPolicy(policy);

            // Act
            var sut = repository.GetPolicy(index);

            // Assert
            sut.Firstname.Should().Be("First");
            sut.Surname.Should().Be("Surname");
        }