Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
themeEmacs
namespace AppAppTest.Adapter
{
    public class GraphEngineTest
    {
        private GraphEngine _graphEngine;

        [SetUp]
        public void SetUp()
        {
            var logger = TestLogger.Create<GraphEngine>();
            var builder = new ConfigurationBuilder()
                .AddJsonFile("appsettings.Development.json");
            var Configuration = builder.Build();

            var options = new AppSettings();
            Configuration.GetSection("AppSettings")
                .Bind(options);
            _graphEngine = new GraphEngine(options, logger);
        }

        [TestCase(TestName = "Step0 - 초기화 생성및 연결 Test")]
        public async Task CreatePersonAreOK()
        {
            _graphEngine.RemoveAll().Wait();

            var cypher = await _graphEngine.GetCypher();

            await cypher.Write
                .Create(@"(alice:Person {name:'홍길동'})")
                .ExecuteWithoutResultsAsync();

            await cypher.Write
                .Create(@"(alice:Person {name:'철수'})")
                .ExecuteWithoutResultsAsync();

            await cypher.Write
                .Create(@"(alice:Movie {name:'스파이더맨'})")
                .ExecuteWithoutResultsAsync();

            await cypher.Write
                .Create(@"(alice:Movie {name:'타이타닉'})")
                .ExecuteWithoutResultsAsync();

            await cypher.Write
                .Match(@"(a: Person),(b: Movie)")
                .Where(@"a.name = '홍길동' AND b.name = '스파이더맨'")
                .Create(@"(a)-[r:뷰]->(b)").ExecuteWithoutResultsAsync();

            await cypher.Write
                .Match(@"(a: Person),(b: Movie)")
                .Where(@"a.name = '철수' AND b.name = '타이타닉'")
                .Create(@"(a)-[r:뷰]->(b)").ExecuteWithoutResultsAsync();

            await cypher.Write
                .Match(@"(a: Person),(b: Person)")
                .Where(@"a.name = '철수' AND b.name = '홍길동'")
                .Create(@"(a)-[r:친구]->(b)").ExecuteWithoutResultsAsync();
        }
    }
}

...