All Test Was Repaired
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||
{
|
||||
public class ConcreteMaterialEntity : IConcreteMaterialEntity
|
||||
{
|
||||
public CodeTypes CodeType { get; set; }
|
||||
public string Name { get; set; }
|
||||
public double MainStrength { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Infrastructures.Strings;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||
{
|
||||
public static class LibMaterialFactory
|
||||
{
|
||||
public static List<ILibMaterialEntity> GetLibMaterials()
|
||||
{
|
||||
List<ILibMaterialEntity> libMaterials = new List<ILibMaterialEntity>();
|
||||
libMaterials.AddRange(GetConcreteEurocode());
|
||||
libMaterials.AddRange(GetConcreteSP63());
|
||||
libMaterials.AddRange(GetReinforcementEurocode());
|
||||
libMaterials.AddRange(GetReinforcementSP63());
|
||||
return libMaterials;
|
||||
}
|
||||
|
||||
private static IEnumerable<ILibMaterialEntity> GetConcreteEurocode()
|
||||
{
|
||||
var code = CodeTypes.EuroCode_2_1990;
|
||||
List<ILibMaterialEntity> libMaterials = new List<ILibMaterialEntity>();
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "C12", MainStrength = 12e6 });
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "C20", MainStrength = 20e6 });
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "C30", MainStrength = 30e6 });
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "C40", MainStrength = 40e6 });
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "C50", MainStrength = 50e6 });
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "C60", MainStrength = 60e6 });
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "C70", MainStrength = 70e6 });
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "C80", MainStrength = 80e6 });
|
||||
return libMaterials;
|
||||
}
|
||||
private static IEnumerable<ILibMaterialEntity> GetReinforcementEurocode()
|
||||
{
|
||||
var code = CodeTypes.EuroCode_2_1990;
|
||||
List<ILibMaterialEntity> libMaterials = new List<ILibMaterialEntity>();
|
||||
libMaterials.Add(new ReinforcementMaterialEntity() { CodeType = code, Name = "S240", MainStrength = 240e6 });
|
||||
libMaterials.Add(new ReinforcementMaterialEntity() { CodeType = code, Name = "S400", MainStrength = 400e6 });
|
||||
libMaterials.Add(new ReinforcementMaterialEntity() { CodeType = code, Name = "S500", MainStrength = 500e6 });
|
||||
return libMaterials;
|
||||
}
|
||||
private static IEnumerable<ILibMaterialEntity> GetConcreteSP63()
|
||||
{
|
||||
var code = CodeTypes.SP63_13330_2018;
|
||||
List<ILibMaterialEntity> libMaterials = new List<ILibMaterialEntity>();
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B5", MainStrength = 5e6 });
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B7,5", MainStrength = 7.5e6 });
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B10", MainStrength = 10e6 });
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B15", MainStrength = 15e6 });
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B20", MainStrength = 20e6 });
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B25", MainStrength = 25e6 });
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B30", MainStrength = 30e6 });
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B35", MainStrength = 35e6 });
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B40", MainStrength = 40e6 });
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B50", MainStrength = 50e6 });
|
||||
libMaterials.Add(new ConcreteMaterialEntity() { CodeType = code, Name = "B60", MainStrength = 60e6 });
|
||||
return libMaterials;
|
||||
}
|
||||
private static IEnumerable<ILibMaterialEntity> GetReinforcementSP63()
|
||||
{
|
||||
var code = CodeTypes.SP63_13330_2018;
|
||||
List<ILibMaterialEntity> libMaterials = new List<ILibMaterialEntity>();
|
||||
libMaterials.Add(new ReinforcementMaterialEntity() { CodeType = code, Name = "A240", MainStrength = 240e6 });
|
||||
libMaterials.Add(new ReinforcementMaterialEntity() { CodeType = code, Name = "A400", MainStrength = 400e6 });
|
||||
libMaterials.Add(new ReinforcementMaterialEntity() { CodeType = code, Name = "A500", MainStrength = 500e6 });
|
||||
return libMaterials;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||
{
|
||||
public interface IConcreteMaterialEntity : ILibMaterialEntity
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||
{
|
||||
public interface ILibMaterialEntity
|
||||
{
|
||||
CodeTypes CodeType { get; }
|
||||
string Name { get; }
|
||||
double MainStrength { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||
{
|
||||
public interface IReinforcementMaterialEntity : ILibMaterialEntity
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||
{
|
||||
public static class LibMaterialPepository
|
||||
{
|
||||
private static List<ILibMaterialEntity> libMaterials;
|
||||
public static List<ILibMaterialEntity> GetRepository()
|
||||
{
|
||||
if (libMaterials is null) { libMaterials = LibMaterialFactory.GetLibMaterials(); }
|
||||
|
||||
return libMaterials;
|
||||
}
|
||||
|
||||
public static IEnumerable<ILibMaterialEntity> GetConcreteRepository(CodeTypes code)
|
||||
{
|
||||
return GetRepository().Where(x => x.CodeType == code & x is IConcreteMaterialEntity); ;
|
||||
}
|
||||
|
||||
public static IEnumerable<ILibMaterialEntity> GetReinforcementRepository(CodeTypes code)
|
||||
{
|
||||
return GetRepository().Where(x => x.CodeType == code & x is IReinforcementMaterialEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Materials.Libraries
|
||||
{
|
||||
public class ReinforcementMaterialEntity : IReinforcementMaterialEntity
|
||||
{
|
||||
public CodeTypes CodeType { get; set; }
|
||||
public string Name { get; set; }
|
||||
public double MainStrength { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user