public async Task CreateAlloy_Throws_WhenCompositionNotUnique()
 {
     #region ARRANGE
     var materialsService = new MaterialsService(inMemoryDbContext);
     var composition      = new Dictionary <string, double>()
     {
         { "Ag", 44.6 }, { "Al", 55.4 }
     };
     #endregion
     #region ACT
     var expectedException = new DuplicateObjectException(string.Empty, string.Empty);
     try
     {
         var alloy = await materialsService.CreateAlloyAsync(composition);
     }
     catch (Exception exception)
     {
         expectedException = exception as DuplicateObjectException;
     }
     #endregion
     #region ASSERT
     Assert.IsAssignableFrom <Exception>(expectedException);
     Assert.NotNull(expectedException);
     Assert.IsType <DuplicateObjectException>(expectedException);
     #endregion
 }
        public async Task CreateAlloy_RetunrsNewAlloy_WithCorrectProperties_WhenCompositionIsUnique()
        {
            #region ARRANGE
            var materialsService = new MaterialsService(inMemoryDbContext);
            var composition      = new Dictionary <string, double>()
            {
                { "Fe", 74.5 }, { "Ti", 25.5 }
            };
            decimal researchCost = 2345.6M;
            #endregion
            #region ACT
            var alloy = await materialsService.CreateAlloyAsync(composition, researchCost);

            #endregion
            #region ASSERT
            Assert.NotNull(alloy);
            Assert.Equal("Fe74.5Ti25.5", alloy.Composition);
            Assert.Equal(researchCost, alloy.ResearchCost);
            #endregion
        }