示例#1
0
        public void WithResources_ShouldReturnResourceWithoutAddingResourcesToResourcesProperty_WhenNullPassed()
        {
            // Arrange
            var resource = new TestResource();

            // Act
            var result = resource.WithResources(null);

            // Assert
            result.Should().BeSameAs(resource);
            result.Resources.Should().BeEmpty();
        }
示例#2
0
        public void WithResources_WithParamsResources_ShouldAddResourceToResourcesPropertyAndReturnResource()
        {
            // Arrange
            var resource      = new TestResource();
            var childResource = new TestResource();

            // Act
            var result = resource.WithResources(childResource);

            // Assert
            result.Should().BeSameAs(resource);
            result.Resources.Should().HaveCount(1);
            result.Resources.First().Should().BeSameAs(childResource);
        }