コード例 #1
0
        public void GetItemByID_ShouldReturnTrueForInSpecialForTheItemThatContainsAllNonDefaults()
        {
            //Arrange
            var jewelRepository = new FakeJewelRepository(new FakeSettingManager());

            //Act
            var jewel = jewelRepository.GetJewelByID(Tests.FAKE_JEWELRY_WITH_ALL_NON_DEFAULT_BEHAVIER);

            //Assert
            jewel.IsSpecial.Should().BeTrue();
        }
コード例 #2
0
        public void GetItemByID_ShouldSetTheRightDealerPrice()
        {
            //Arrange
            var jewelRepository = new FakeJewelRepository(new FakeSettingManager());

            //Act
            var jewel = jewelRepository.GetJewelByID(Tests.FAKE_JEWELRY_REPOSITORY_FIRST_ITEM_ID);

            //Assert
            jewel.DealerPrice.Should().Be(7000);
        }
コード例 #3
0
        public void GetItemByID_ShouldReturnFalseForInSpecial()
        {
            //Arrange
            var jewelRepository = new FakeJewelRepository(new FakeSettingManager());

            //Act
            var jewel = jewelRepository.GetJewelByID(Tests.FAKE_JEWELRY_REPOSITORY_FIRST_ITEM_ID);

            //Assert
            jewel.IsSpecial.Should().BeFalse();
        }
コード例 #4
0
        public void GetItemByID_ShouldSetTheJewelPriceLikeARegularPriceBecauseItemIsNotSpecialAndUserIsNotADealer()
        {
            //Arrange
            var jewelRepository = new FakeJewelRepository(new FakeSettingManager());

            //Act
            var jewel = jewelRepository.GetJewelByID(Tests.FAKE_JEWELRY_REPOSITORY_FIRST_ITEM_ID);

            //Assert
            jewel.Price.Should().Be(jewel.RegularPrice);
        }
コード例 #5
0
        public void GetItemByID_ShouldSetTheJewelPriceLikeTheSpecialPriceBecauseItemIsOnSpecial()
        {
            //Arrange
            var jewelRepository = new FakeJewelRepository(new FakeSettingManager());

            //Act
            var jewel = jewelRepository.GetJewelByID(Tests.FAKE_JEWELRY_WITH_ALL_NON_DEFAULT_BEHAVIER);

            //Assert
            jewel.Price.Should().Be(jewel.SpecialPrice);
        }
コード例 #6
0
        public void GetItemByID_ShouldSetTheJewelPriceLikeTheSpecialPriceBecauseItemIsOnSpecial()
        {
            //Arrange
            var jewelRepository = new FakeJewelRepository(new FakeSettingManager());

            //Act
            var jewel = jewelRepository.GetJewelByID(Tests.FAKE_JEWELRY_WITH_ALL_NON_DEFAULT_BEHAVIER);

            //Assert
            jewel.Price.Should().Be(jewel.SpecialPrice);
        }
コード例 #7
0
        public void GetItemByID_ShouldReturnTheRightID()
        {
            //Arrange
            var jewelRepository = new FakeJewelRepository(new FakeSettingManager());

            //Act
            var jewel = jewelRepository.GetJewelByID(Tests.FAKE_JEWELRY_REPOSITORY_FIRST_ITEM_ID);

            //Assert
            jewel.ID.Should().Be(Tests.FAKE_JEWELRY_REPOSITORY_FIRST_ITEM_ID);
        }
コード例 #8
0
        public void GetItemByID_ShouldSetTheJewelPriceLikeARegularPriceBecauseItemIsNotSpecialAndUserIsNotADealer()
        {
            //Arrange
            var jewelRepository = new FakeJewelRepository(new FakeSettingManager());

            //Act
            var jewel = jewelRepository.GetJewelByID(Tests.FAKE_JEWELRY_REPOSITORY_FIRST_ITEM_ID);

            //Assert
            jewel.Price.Should().Be(jewel.RegularPrice);
        }
コード例 #9
0
        public void GetItemByID_ShouldReturnTrueForInSpecialForTheItemThatContainsAllNonDefaults()
        {
            //Arrange
            var jewelRepository = new FakeJewelRepository(new FakeSettingManager());

            //Act
            var jewel = jewelRepository.GetJewelByID(Tests.FAKE_JEWELRY_WITH_ALL_NON_DEFAULT_BEHAVIER);

            //Assert
            jewel.IsSpecial.Should().BeTrue();
        }
コード例 #10
0
        public void GetItemByID_ShouldReturnTheRightID()
        {
            //Arrange
            var jewelRepository = new FakeJewelRepository(new FakeSettingManager());

            //Act
            var jewel = jewelRepository.GetJewelByID(Tests.FAKE_JEWELRY_REPOSITORY_FIRST_ITEM_ID);

            //Assert
            jewel.ID.Should().Be(Tests.FAKE_JEWELRY_REPOSITORY_FIRST_ITEM_ID);
        }
コード例 #11
0
        public void GetItemByID_ShouldReturnFalseForInSpecial()
        {
            //Arrange
            var jewelRepository = new FakeJewelRepository(new FakeSettingManager());

            //Act
            var jewel = jewelRepository.GetJewelByID(Tests.FAKE_JEWELRY_REPOSITORY_FIRST_ITEM_ID);

            //Assert
            jewel.IsSpecial.Should().BeFalse();
        }
コード例 #12
0
ファイル: FakeFactory.cs プロジェクト: mamluka/JewelryONet
 public static Jewel Jewel()
 {
     var jewelRepository = new FakeJewelRepository(new FakeSettingManager());
     return jewelRepository.GetJewelByID(Tests.FAKE_JEWELRY_REPOSITORY_FIRST_ITEM_ID);
 }
コード例 #13
0
        public void GetItemByID_ShouldSetTheRightSpecialPrice()
        {
            //Arrange
            var jewelRepository = new FakeJewelRepository(new FakeSettingManager());

            //Act
            var jewel = jewelRepository.GetJewelByID(Tests.FAKE_JEWELRY_REPOSITORY_FIRST_ITEM_ID);

            //Assert
            jewel.SpecialPrice.Should().Be(8000);
        }